Elixir and Nerves is fun!
A Phoenix-Channel listen on messages from web-clients and switch LEDs on and off.
In the other direction, pressing the button triggers a
Phoenix-channel broadcast to the server, the server randomizes the
three leds and sets them through
Because setting the LED status broadcasts to all web clients,
each display of the buttons on screen is in sync with the LEDs
on Raspberry’s breadboard.
A Pretty Strong Team
The best thing about Nerves is the way you can update your raspberry over WiFi without fiddling around with SDCards. All you have to do is
... code ...
mix firmware.push nerves.local
... test ...
I added a thermometer-circuit and a display for the current temperature using the PCF8591 A/D-converter.
Circuit For Button and LEDs
Extended With Circuit For Thermo-resistor And PCF8591
The code for the thermo-extension is at Github-commit
A big credit for Arkham’s Example