Linnea timer

linnea timer

unsigned long sekunder = 10; 

void setup() 
{
  pinMode(2, INPUT);      
  pinMode(9, OUTPUT);     
  pinMode(12, OUTPUT);    
  pinMode(13, OUTPUT);    
  digitalWrite(13, HIGH);  
}

void loop() 
{
  int buttonState = digitalRead(2);
  sekunder = sekunder*1000;
  if(buttonState == HIGH)
  {
    digitalWrite(13, LOW);
    digitalWrite(12, HIGH);
    delay(sekunder);
    digitalWrite(13, HIGH);
    digitalWrite(12, LOW);
    tone(9,440,1000);
  }
  else
  {
  }
}

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s