Perform code that causes the D1 LED to be off when an odd decimal numeric digit of between {1,3,5,7,9} is sent from the PC to the arduino and lit if the sent digit is between { 0.2,4,6,8}.
How would I do this?
That's what I've done so far:
#define LED 4
lista[] = ['1','3','5','7','9','0','2','4','6','8']
void setup(){
Serial.begin(9600);
pinMode(pin_led, OUTPUT);
}
void loop(){
if(lista[]=)
if analogRead(lista[n],HIGH){
digitalWrite(LED, LOW);
}
else{
digitalWrite(LED, HIGH);
}
}