Created
March 29, 2014 17:41
-
-
Save eggie5/9858756 to your computer and use it in GitHub Desktop.
connect to a USB host over serial arduino
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
| uint8_t counter; | |
| void setup() { | |
| Serial.begin(115200); | |
| SerialUSB.begin(115200); // speed is irrelevant for native port | |
| counter = 0; | |
| } | |
| byte lat; | |
| void loop() { | |
| Serial.print("Programming port. Counter is at "); | |
| Serial.println( counter); | |
| // SerialUSB.print("Native port. Counter is at "); | |
| //SerialUSB.println( counter); | |
| while(SerialUSB.peek()!=-1) | |
| { | |
| lat = SerialUSB.read(); | |
| SerialUSB.print("new byte is:"); | |
| SerialUSB.println(lat); | |
| } | |
| //counter++; | |
| delay(500); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment