Hi,
I was testing webUSB but I got no success in getting data from Arduino. So I made a simple test with console demo.
I let Arduino print ok every second. However, the transferIn in web does not trigger until I type something in console.
Tested on Mac OS 10.10.5
void loop() {
static unsigned long previousMillis = 0;
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= 1000) {
previousMillis = currentMillis;
Serial.println("OK");
}
if (Serial && Serial.available()) {
int byte = Serial.read();
Serial.write(byte);
if (byte == 'H') {
Serial.write("\r\nTurning LED on.");
digitalWrite(ledPin, HIGH);
} else if (byte == 'L') {
Serial.write("\r\nTurning LED off.");
digitalWrite(ledPin, LOW);
}
Serial.write("\r\n> ");
Serial.flush();
}
}
Hi, I was testing webUSB but I got no success in getting data from Arduino. So I made a simple test with console demo. I let Arduino print ok every second. However, the transferIn in web does not trigger until I type something in console.
Tested on Mac OS 10.10.5