int lastIncrementState = 0;
const int button1Pin = 2;
const int buzzerPin = 9;
const int led1 = 3;
void setup()
{
// Here we'll configure the Arduino pins we're using
// LEDs are to be outputs, and buttons are inputs:
pinMode(button1Pin, INPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(led1, OUTPUT);
}
{
// Here we'll configure the Arduino pins we're using
// LEDs are to be outputs, and buttons are inputs:
pinMode(button1Pin, INPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(led1, OUTPUT);
}
void loop()
{
if (button1State != lastIncrementState)
{
if (button1State == LOW)
{buzzerPin(tone);
digitalWrite(led1, HIGH);
}
lastIncrementState = button2State;
}
}
No comments:
Post a Comment