Have yourself a high noon standoff right in your own home
To be submitted as part of "YeeHaw Hacks" hackathon by MLH
Now, who doesn't love them a good ol' fashioned duel! Sure is a shame they're outlawed... unless?
+---------------------------+
|Server waits for connection| Establish TCP connection with server
+-+-------------------------+
|
|
v
+-+---------------------+
|Client-Server handshake| Complete handshake to check
| (for each client) | if communication is working
+-+---------------------+
|
|
v
+-+--------------+
|Countdown begins| The duel will commence after we count to ten
+-+--------------+
|
|
v
+-+-----------+
|Clients shoot| Server recieves packets and determines winner
+-+-----------+
|
|
v
+-+----------------------+
|Server broadcasts winner| Send client unique packet with win/loss
+------------------------+
- NodeMCU
- Push Button
- 10K ohm resistor
- RGB LED
- Breadboard
- Wires
- Toy gun (optional)
- Go
- Arduino CLI
- Make
- BASH (for automating installing NodeMCU cores)
# Building & running the server
###############################
cd server
go build
# Make sure to port forward port 1337
# before running the server
./qd-server
# Compiling and flashing the NodeMCU
####################################
cd client
chmod +x prepare.sh
./prepare.sh
# Edit NodeMCU/connection.h and set the
# variables to meet your connection needs
# Set PORT to the port of your NodeMCU
make PORT=/dev/ttyUSBX flash