Advertisement
pleasedontcode

"Serial Display" rev_01

Jun 14th, 2025
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: "Serial Display"
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2025-06-14 22:45:56
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* It reads video input from pin 9. It processes */
  21.     /* graphics. It outputs composite video from pin 9 */
  22.     /* and pin 7 */
  23. /****** END SYSTEM REQUIREMENTS *****/
  24.  
  25. /* START CODE */
  26.  
  27. /****** DEFINITION OF LIBRARIES *****/
  28. #include <TVout.h> // Include the TVout library for video output
  29.  
  30. /****** FUNCTION PROTOTYPES *****/
  31. void setup(void);
  32. void loop(void);
  33.  
  34. /***** DEFINITION OF DIGITAL INPUT PINS *****/
  35. const uint8_t pico_PIN_D2 = 2; // Define input pin for video input
  36. const uint8_t videoOutputPin1 = 9; // Define output pin for composite video
  37. const uint8_t videoOutputPin2 = 7; // Define second output pin for composite video
  38.  
  39. /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
  40. TVout TV; // Create an instance of the TVout class
  41.  
  42. void setup(void)
  43. {
  44.     // put your setup code here, to run once:
  45.     pinMode(pico_PIN_D2, INPUT); // Set the input pin for video input
  46.     pinMode(videoOutputPin1, OUTPUT); // Set the first output pin for composite video
  47.     pinMode(videoOutputPin2, OUTPUT); // Set the second output pin for composite video
  48.  
  49.     // Initialize TV output
  50.     TV.begin(PAL, 120, 96); // PAL or NTSC
  51.     TV.select_font(font6x8);
  52.     TV.println("Booting...");
  53.     Serial.begin(9600); // Initialize serial communication
  54. }
  55.  
  56. void loop(void)
  57. {
  58.     // put your main code here, to run repeatedly:
  59.     if (Serial.available()) {
  60.         String msg = Serial.readStringUntil('\n');
  61.         TV.clear_screen();
  62.         TV.println(msg);
  63.     }
  64. }
  65.  
  66. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement