const int PinKey = 3;
const int PinLed = 2;
bool ActLed = 0;
void setup(){
pinMode( PinLed, OUTPUT );
pinMode( PinKey, INPUT );
}
void loop(){
if( digitalRead(PinKey)){
ActLed = !ActLed;
digitalWrite(PinLed, ActLed);
while(digitalRead(PinKey)){
delay(30);;
}
}
}