Last active
August 29, 2015 14:26
-
-
Save constellates/6b155c6f9539b05146e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Adafruit_Thermal.h" | |
// Pass addr to printer constructor | |
Adafruit_Thermal printer(&Serial1); | |
Adafruit_Thermal printer2(&Serial3); | |
// ----------------------------------------------------------------------- | |
void setup() { | |
Serial1.begin(19200); // Initialize serial with printer baudrate | |
Serial3.begin(19200); | |
printer.begin(); // Init printer | |
printer2.begin(); | |
/** | |
* HOW CAN I MAKE THESE TWO FUNCTIONS EXECUTE | |
* RELATIVELY SIMULTANEOUSLY? OR ASYNCHRONOUSLY. | |
*/ | |
printer.println(F("Testing printer 1!")); | |
printer2.println(F("Testing printer 2!")); | |
printer.sleep(); // Tell printer to sleep | |
printer2.sleep(); // Tell printer to sleep | |
delay(3000L); // Sleep for 3 seconds | |
printer.wake(); // MUST wake() before printing again, even if reset | |
printer2.wake(); // MUST wake() before printing again, even if reset | |
printer.setDefault(); // Restore printer to defaults | |
printer2.setDefault(); // Restore printer to defaults | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment