Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: Serial Hello
- - Source Code NOT compiled for: Arduino Pro Mini 3.3V
- - Source Code created on: 2025-06-04 17:51:24
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* print hello */
- /****** END SYSTEM REQUIREMENTS *****/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- // Since Print.h is an abstract class, define a simple implementation for demonstration.
- class SerialPrint : public Print {
- public:
- size_t write(uint8_t byte) override {
- Serial.write(byte);
- return 1;
- }
- };
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- // Instantiate the Print object
- SerialPrint myPrint;
- void setup(void)
- {
- // Initialize Serial communication at 9600 baud
- Serial.begin(9600);
- // Wait for serial port to connect. Needed for native USB port only
- while (!Serial) {
- ; // wait for serial port to connect.
- }
- // Print "hello" to serial monitor
- myPrint.write('h');
- myPrint.write('e');
- myPrint.write('l');
- myPrint.write('l');
- myPrint.write('o');
- myPrint.write('\n');
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement