firstly, im using cable db9 for this serial communication...
void setup(){
Serial.begin(9600);
}void loop(){
Serial.println("Hello");
delay(500);
}
im testing this code and its all ok..but when im testing the code below, its not functionned..can someone give me a help on this please...
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
}void loop()
{
if (Serial.available() > 0)
{
int incoming = Serial.read();if ((char)incoming == '1')
{
digitalWrite(13, HIGH);
Serial.println("On");
}
else if ((char)incoming >= '2')
{
digitalWrite(13, LOW);
Serial.println("Off");
}
}
}
im using cable db9 and max 232 for make my wiring...when im using USB cable,there is no problems...