hi,
i bought a apc220 module and i create a program that turn on a led when i write b and turn off when i write c in serial window.
i try the program with usb cable and work it then i try the program with the wireless module but didn’t work.
int val = 0;
int ledPin = 13;
void setup()
{
Serial.begin(9600);
pinMode(ledPin,OUTPUT);
}
void loop()
{
val = Serial.read();
if (-1 != val) {
if ('A' == val || 'a' == val) Serial.println("Segnale ricevuto");
else if ('B' == val || 'b' == val) digitalWrite(ledPin, HIGH);
else if ('c' == val || 'C' == val) digitalWrite(ledPin, LOW);
}
}
how i fix it??