so I eventually got round to building the board, and started testing the software side of things. After a very disappointing start (ws2812b + heat = no light!) I eventually got it running some basic code.
A few hours later and some searching, I have some basic switching going on. Its a mash up of random example code and a neopixel library all in arduino code (I can hear the screams from here). We have some basic functions:
- On first power up, the board just goes straight to sleep.
- On pressing the button, the neopixel flashes for 5 seconds, the colour indicative of the voltage 4.2v = green - 3.3v = red, with a combination of the 2 in between.
- If the button is not still pressed at the end of the flashing, the board goes back to sleep
- If the button is still pressed, the FET is activated, and the neopixel shows a steady indicator of voltage (same green to red system as before)
- While the FET is on, if the button is held down for 2 seconds, the FET will be switched off, and the board will go to sleep
Im sure the code is shockingly bad, but its a start
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Nice. It would be nice if it could send a signal to the pi to shut down, and wait for it to do it, instead of switching the FET off right away. There is a million ways to tell the pi to shut down on a gpio signal.
Are you sure? yes | no
well i have 2 spare pins, i was going to experiment with i2c, so the pi can actually request the current voltage, and signal shutdowns too. they could also be used for normal signalling too :)
Are you sure? yes | no