Now, I’ve made a board with 16 modified buttons and some micropython code.
White = mole, green = hit in time, red = wrong button/out of time, rainbow = bonus points.
Now i have to think of a display and select buttons, to select the game mode and see the score.
Schematic
Above is a simplified schematic. See notes below.
Led rings are 8 not in example 12 (didn’t have that part in fritzing)
Led rings have 5V, GND, DI (data in) and DO (data out)
Led rings are connected in series, python code divides by 8
GPIO for buttons (16 yellow) have internal PICO pullup resistors
Todo: Screen and mode select
Game modes : Currently I can think of four.
1 Player mode – with bonus button – works kindda
2 Player mode – Green player 1 and Blue player 2 – need testing
2 Player mode (half playfield) … todo
Above with mixed random colors, press only GREEN (or blue) .. todo
1 Player mode – all random colors + bonus .. todo
1 Player mode – with bonus button – keep bonus pressed for 5 seconds to double, so you need to single hand press others. (Missing is reset bonus?!?) … todo
Button keeps lit until pressed .. do 10 in a row. Print fastest and average time… todo
Speedup ?
Scoreboard – using a HUB75 (previous project here)
I needed to change a lot to the javascript on the website to fix some stuff.
Fix IPhone control. (I hate iphone)
Fix screenlock timeout
Added meta refresh
The XMAS/Fireworks controller was often used, and I got notifications via my TV. (see other posts)
Now I want to see when MQTT movement when I’m in the livingroom. So I programmed a Wemos controller to blink the internal when MQTT messages are received.
CODE:
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const char* ssid = "WIFIAP";
const char* password = "WIFIPASS";
const char* mqtt_server = "MQTTBROKER"; // MQTT broker IP
const char* mqtt_topic = "game/tilt";
WiFiClient espClient;
PubSubClient client(espClient);
String lastPayload = "";
void setup_wifi() {
delay(10);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
}
void blinkLED() {
digitalWrite(LED_BUILTIN, LOW); // LED ON
delay(200);
digitalWrite(LED_BUILTIN, HIGH); // LED OFF
delay(200);
}
void callback(char* topic, byte* payload, unsigned int length) {
String message;
for (unsigned int i = 0; i < length; i++) {
message += (char)payload[i];
}
// Blink only if topic value changed
if (message != lastPayload) {
blinkLED();
lastPayload = message;
}
}
void reconnect() {
while (!client.connected()) {
if (client.connect("WemosClientMqttBlink")) {
client.subscribe(mqtt_topic);
} else {
delay(2000);
}
}
}
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
setup_wifi();
client.setServer(mqtt_server, 1883);
client.setCallback(callback);
}
void loop() {
if (!client.connected()) {
reconnect();
}
client.loop();
}
Another game in the making is a Red Light – Green Light game. Like in Squid Game. This will use a lidar and a python script which detect movement using a camera.
While this is a old project from 2019, I decided to make a more responsive one, after my friend Tyrone mentioned a project somewhere on the internet (forgot where). Time to dust off this project!
2019 version
Above version worked but was slow. I used a python script to send values to de controller.
Memory setup was the same.
Below my new schematic, using an opamp to drive the analog meter.
Untested design .. Yeah I got bored on new year’s eve
Utilizing a MCP41000 digital potmeter and a LM358 signal amplifier I hope to get a more responsive setup.
We are planning to redo our garden. And I am making a water and light plan for it.
I thought I could do it myself using 12V and RS485/Modbus.
So these are my plans. (NOTE, this is a work in progress)
I’m going to put 4-wire ground cable in our garden, and a RS485/Modbus master controller in my shed. 4 Wires will have 12V low voltage, ground and RS485 A/B wires. This way I can control till 64 devices on a single cable.
Below, a USB stick to connect the RS485 cables to a Raspberry Pi? Software is probably going to be a NodeRed instance connected to Home Assistant.
On/Off lights using a RS485 board and relay. These can be bought on a single PCB and can control 220V. I am probably going to use generic outside lamps and refit them for 12V led or 220v, with those RS485 controllers.
Test PCB
The above left part will be encased in resin or alike. Right PCB is for testing only.
For dimming RGB lights, I made the below design.
NOTE: This needs 120ohm end resistor and capacitors over the 7805.
12V to 5V using a 7805, RS485 8pin DIL/DIP and a ATTiny85 8pin DIL/DIP. Plus a 4×4 RGB Matrix. These also encased in resin.
More information on the ATTiny85 and programmer can be found here: