The code in Arduino Due to send "Hello Pi" to USB and toggle LED repeatly every second.
int pinLED = 13;
boolean ledon;
void setup() {
Serial.begin(9600);
pinMode(pinLED, OUTPUT);
ledon = true;
}
void loop() {
Serial.print("Hello Pi\n");
digitalWrite(pinLED, ledon = !ledon);
delay(1000);
}
The code simple send "Hello Pi" to Serial port (USB) repeatly. After download to your Arduino board, you can use the build-in Tools > Serial Monitor to varify it.
No comments:
Post a Comment