Hi I'm having a mental breakdown right now.
I don't know why.
Why does the Arduino stop if the communication is connected and recived data when the power is off?
Help. please.
- Normal operation
- Check RS232 Communication
-
Power off
-
Power on
Cable : USB to RS232 ( NETmate USB2.0 to RS232)
RS232 module : Manufacturing: YwRobot ( RS232 - TTL Module [MCU030310])
LCD : 2004 LCD(I2C Control.)
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27 ,20,4);
void setup() {
delay(1000);
lcd.init();
lcd.backlight();
Wire.begin();
Serial.begin(9600);
Serial.setTimeout(100);
Serial.println("ok");
}
void loop() {
RS232_PC2();
clcd_display();
}
void clcd_display (){
lcd.setCursor(0,0);
lcd.print("Running");
}
void RS232_PC2(){
String inputStr = "a";
if(Serial.available() > 0)
{
inputStr = Serial.readStringUntil('\r');
}
else {
return;
}
if (inputStr == "A") {
Serial.println("A");
}
}
Thank you.