[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 574: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 630: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Plum Geek Forum • Disabled User Button Interfering with Neopixels
Page 1 of 1

Disabled User Button Interfering with Neopixels

Posted: Fri Jan 08, 2016 2:19 am
by mikasami

Re: Disabled User Button Interfering with Neopixels

Posted: Mon Jan 11, 2016 8:30 pm
by Kevin
I think we cleared this up in an email conversation but wanted to respond here also in case anyone else had the same question.

The button is on the same line as the Neopixels. We had to do this because that small Arduino processor doesn't have very many I/O lines. To use the button together with the NeoPixels, the best way is to set the pin to INPUT_PULLUP which enables the weak pull-up of the line. When you press the button it will pull this low.

So even if you're flashing and updating the pixels, you can still quickly in your code change this to an INPUT_PULLUP then go read the pin - if it's low then the button is being pressed. You may need to have a short delay between setting the pull-up, maybe an extra line of delayMicroseconds(200); or something between them. Then you can go right back to running the pixels following this.

Pushing the button with the pixels updating doesn't hurt anything as there's a resistor between the processor and the button/pixels. Pushing the button will just block the data from reaching the pixels so they won't update while the button is being pressed.