I read somewhere that the Rx Tx pin must be disconnected before uploading the code. If this is true my question is why? How can I make a reliable system if I constantly have to remove the pins to get my code to run? There has to be a workaround.
Code: Select all
int led = 13;
void setup() {
Serial1.begin(9600);
Serial.begin(9600);
while(!Serial1 && millis()<5000) {
//wait for serial monitor to connect
}
}
void loop() {
Serial.print(Serial1.available()); // Equals 0 all the time
while(Serial1.available()){
digitalWrite(led, HIGH);
Serial1.print('H');
delay(500);
digitalWrite(led, LOW);
delay(500);
}
}