Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
int inputPin = 0;
int ledPin = 12;
int buttonState = 0;
int buttonStateTm1 = 0;
int ledState = LOW;
void setup() {
pinMode(inputPin, INPUT);
pinMode(ledPin, OUTPUT);
void loop() {
buttonState = digitalRead(inputPin);
if(buttonState > buttonStateTm1){
ledState = !ledState;
digitalWrite(ledPin, ledState);
buttonStateTm1 = buttonState;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.