Hi folks, I’m a newbie on grovePi, but I’ve some experience in python and Arduino, well…
The following simple script has no output e break it execution itself
button = 3
Obviously tried other pins but the problem is still here, and tried the grove_led_blink.py script from the dexter repository that works with no hassle.
So I guess that my problem isn’t hardware related.
How I’m wrong?
A couple of thoughts:
- Do you have the button connected between power and ground on the grove connector through a pull-up resistor?
For example, if you have a normally closed switch and a 5k fractional watt resistor, you’d hook one end of the resistor to the positive voltage point, the other end to the switch, the other end of the switch to ground, and the center-point to your digital input pin. With the switch un-pressed, you get a digital zero, (ground), and when pressed you get a digital one, (positive voltage). If you use a normally open switch, you’ll get the same thing, except the logical polarity will be reversed - 1 when not pressed and 0 when pressed.
If you don’t have a pull-up resistor connected, it won’t work because there’s no voltage reference.
- Are you absolutely sure you’re using the correct pin?
Let us know what happens!
Very late to the party, but just in case someone reads this–I had an identical issue, which was fixed on a firmware update.