Disabled User Button Interfering with Neopixels

Ringo setup, hardware, basic programming. User to user support.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
mikasami
Posts: 10
Joined: Tue Sep 15, 2015 3:37 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Disabled User Button Interfering with Neopixels

Postby mikasami » Fri Jan 08, 2016 2:19 am


Kevin
Posts: 180
Joined: Tue Jul 28, 2015 12:56 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Disabled User Button Interfering with Neopixels

Postby Kevin » Mon Jan 11, 2016 8:30 pm

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.


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 31 guests