#include <Servo.h>
Servo myservo;
unsigned long int future = 0;
int stav = 0;
void setup() {
DDRD &=~(1<<6); //pinMode(6, INPUT);
DDRD &=~(1<<7); //pinMode(7, INPUT);
myservo.attach(11);
myservo.write(0);
DDRD |=1<<4;
DDRD |=1<<2; //pinMode(2, OUTPUT);
DDRD |=1<<3; //pinMode(3, OUTPUT);
PORTD |=1<<2; //digitalWrite(2, LOW);
PORTD |=1<<3; //digitalWrite(3, LOW);
PORTD |=1<<4;
future = millis();
}
void loop() {
if( (PIND&(1<<6)) != 0 && test1 == true){
myservo.write(90);
PORTD &=~(1<<2);
test1 = false;
}
else if( (PIND&(1<<6)) == 0 && test1 ==false){
myservo.write(0);
PORTD |=1<<2;
test1 = true;
}
}