Skip to content

TechHacks-Competitive/Quick-Draw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick-Draw

Have yourself a high noon standoff right in your own home

To be submitted as part of "YeeHaw Hacks" hackathon by MLH

Video Demo

COVID-1819 Yeehaw

Who Lives, Who Dies, Who Tells Your Story

Now, who doesn't love them a good ol' fashioned duel! Sure is a shame they're outlawed... unless?

Execution

+---------------------------+
|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
+------------------------+

Do It Yourself

Hardware

  • NodeMCU
  • Push Button
  • 10K ohm resistor
  • RGB LED
  • Breadboard
  • Wires
  • Toy gun (optional)

Software

  • 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