const int key = 2;
const int led = 10;
bool action = 0;
void setup() {
// put your setup code here, to run once:
pinMode(key, INPUT);
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
action = digitalRead(key);
digitalWrite(led, !action);
}