Counting things seems relatively easy, until it isn’t! In this project, I used Redis to maintain a central count that was displayed on and could be updated from a range of different interfaces. Each interface needed to stay in sync at all times - an update to the count from any interface should update the value of the count shown on that interface and all others at the same time.
For this I used Redis keyspace notifications and built a web interface plus a physical display with a Raspberry Pi, 7 segment display and arcade button. The code was written in a mix of Python and Node.js.
This was the fourth project in my Things on Thursdays IoT live streaming series.
In this two week project I demonstrated how to count things using Redis, then synchronise multiple devices to display the current count. In the first week, I looked at doing this for a web interface with Node.js and Express:
In the second part of this two week project, I implemented an additional counter and display using arcade buttons, a TM1637 7 digit display and a Raspberry Pi 3. I wrote this in Python.
- Source code for this project on Github
- TM1637 7 segment display - Arduino example
- gpiozero library used for the arcade buttons
- Redis Keyspace Notifications
Main photograph - Kraftwerk performing “Numbers” from YouTube.