unsigned int led = 13; void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); //Initialize serial and wait for port to open: Serial1.begin(9600); Serial2.begin(9600); Serial2.println("Hello Computer"); } void loop() { //digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) ///delay(50); // wait for a second //digitalWrite(led, LOW); // turn the LED off by making the voltage LOW //delay(50); // wait for a second // read from port 2, send to port 1: if (Serial2.available()) { //Serial2.print(inByte); Serial1.write(Serial2.read()); } // read from port 1, send to port 2: if (Serial1.available()) { Serial2.write(Serial1.read()); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)