int led = 4;
int choise;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("1 Or 0 ?");
while (Serial.available)
int choise = Serial.parseInt();
Serial.print("the choise is: ");
Serial.println(choise);
switch (choise){
case 1 :
digitalWrite(led, HIGH);
break;
case 0:
digitalWrite(led, LOW);
break;
}
}