- Mon Dec 15, 2014 2:30 pm
#177753
Hey guys,
I'm trying to use this arduino sketch
I've managed to use the code successfully with a normal four leg switch. But I'm not sure about the button's connections, any idea? :neutral:
Thanks in advance
I'm trying to use this arduino sketch
const int buttonPin = 2;...with this momentary button (https://www.sparkfun.com/products/11966)
int buttonState = 0;
void setup() {
Serial.begin(9600);
pinMode(buttonPin, INPUT);
}
void loop(){
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
Serial.println("Ojete");
}
}
I've managed to use the code successfully with a normal four leg switch. But I'm not sure about the button's connections, any idea? :neutral:
Thanks in advance