I have been trying to write code that would wait until a the USBSerial buffer was above ~10 characters. It seems that when I actually run the program I can only return a 0 or 1 from the SerialUSB.available() command. Is there a fix for this? I have included some test code to demonstrate. When the program is running you type into a serial terminal. As you type the number printed is supposed to increase. It stops at 1...
Any help would be greatly appreciated.
void setup() {
}
void loop() {
SerialUSB.print(SerialUSB.available())
delay(100); // Slow down the program
}