const int switchpin=2;
const unsigned long debouncetime=40;
bool schalter=LOW;
bool merker=LOW;
unsigned long lasttime=0;
const int LED=LED_BUILTIN;
void setup()
{
pinMode (10, INPUT_PULLUP);
pinMode (9, OUTPUT);
}
void loop()
{
if (millis()-lasttime>debouncetime)
{
if (digitalRead (10))
{
lasttime=millis();
if (!merker)
{
schalter=!schalter;
merker=HIGH;
}
}
else
{
merker=LOW;
}
}
digitalWrite (9,schalter);
}