diff --git a/hardware/digistump/avr/libraries/DigisparkCDC/examples/Echo/Echo.ino b/hardware/digistump/avr/libraries/DigisparkCDC/examples/Echo/Echo.ino index 6b03377..59f358d 100644 --- a/hardware/digistump/avr/libraries/DigisparkCDC/examples/Echo/Echo.ino +++ b/hardware/digistump/avr/libraries/DigisparkCDC/examples/Echo/Echo.ino @@ -2,7 +2,6 @@ void setup() { // initialize the digital pin as an output. SerialUSB.begin(); - SerialUSB.println("CDC Test"); } // the loop routine runs over and over again forever: @@ -12,5 +11,11 @@ void loop() { SerialUSB.write(SerialUSB.read()); } - SerialUSB.delay(10); // keep usb alive // can alos use SerialUSB.refresh(); + //SerialUSB.delay(10); + /* + if you don't call a SerialUSB function (write, print, read, available, etc) + every 10ms or less then you must throw in some SerialUSB.refresh(); + for the USB to keep alive - also replace your delays - ie. delay(100); + with SerialUSB.delays ie. SerialUSB.delay(100); + */ } \ No newline at end of file diff --git a/hardware/digistump/avr/libraries/DigisparkCDC/examples/Print/Print.ino b/hardware/digistump/avr/libraries/DigisparkCDC/examples/Print/Print.ino new file mode 100644 index 0000000..1454e31 --- /dev/null +++ b/hardware/digistump/avr/libraries/DigisparkCDC/examples/Print/Print.ino @@ -0,0 +1,25 @@ +#include +void setup() { + // initialize the digital pin as an output. + SerialUSB.begin(); + /* + remember the SerialUSB starts as soon as you call begin + and doesn't restart the board when you open the serial monitor + (like the uno does) - so if you print to it and you don't + have a serial monitor open that text is lost. + */ +} + +// the loop routine runs over and over again forever: +void loop() { + + SerialUSB.println(F("TEST!")); //wrap your strings in F() to save ram! + + //SerialUSB.delay(10); + /* + if you don't call a SerialUSB function (write, print, read, available, etc) + every 10ms or less then you must throw in some SerialUSB.refresh(); + for the USB to keep alive - also replace your delays - ie. delay(100); + with SerialUSB.delays ie. SerialUSB.delay(100); + */ +} \ No newline at end of file