int button = 0;
void setup() {
// put your setup code here, to run once:
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(8, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
button=digitalRead(8);
if(button == 1)
{
analogWrite(5, 255);
analogWrite(3, 0);
Serial.println("an");
delay(100);
}
else
{
analogWrite(3, 255);
analogWrite(5, 0);
Serial.println("aus");
delay(100);
}
}