Skip to content

nitroxgas/bitcorn-hole

 
 

Repository files navigation

image

Bitcorn Hole 🌽🕳️

Bitcorn Hole is a physical hardware game where players earn bitcoin every time they score a point! Bean bags are tossed into the cornhole set and detected using microcontrollers with time-of-flight sensors or load cells(a scale). Each point scored triggers an instant payment of sats to the player’s Lightning Address! ⚡

Live Demo

See how the game works in action here and here.

What You’ll Need

To build your own Bitcorn Hole setup, you’ll need the following:

Set with a ToF sensor:

Massive thanks to Dani Go for her soldering help!

Set with scales, or load cell sensor:

Optional, but a great addition - LED Bars to display the points in front of the set:

Code and Setup

There are three main code files in this repository:

  1. Frontend Webpage: This displays the game interface and real-time scoring updates.
    Frontend Code - Coming Soon | View Screenshot

  2. Microcontroller Code: This code runs on each microcontroller, hosting a web server and interfacing with the sensors to detect when a bean bag is present.
    View ToF Microcontroller Code - Arduino IDE To build a set with scales to detect more than one bag, without have to collect them each time one scores. You must install VSCode and at VSCode extensions (Ctrl+Shift+X), you must install PlatformIO IDE. Clone this repo, and configure the lines below in platformio.ini file to match your configurations: build_flags = -DESP32_DEV=1 ; To use a ESP32 board -DLOADCELLS=1 ; Uses a weigth scale -DBAGWEIGHT=200 ; bag weight in grams -DTOLERANCE=25 ; weight tolerance in grams -DLED_SCORE_BAR=19 ; GPIO pin for LED score bar Comment this line with a ; if you do not have a LED Bar -DLED_SIZE=10 ; number of LEDs in the score bar -DTEAM_COLOR=1 ; 1 = Red 0 = Blue - You must change this and compile to install the different player version in the microcontrollers

  3. API to Pay Sats: This handles the instant payments to players' Lightning Addresses. You can substitute your own API endpoint, and either run your own LND node or use a custodial API like ZBD.
    API Code - Coming Soon

Gameplay Instructions

Bitcorn Hole in Your Community

Did you bring Bitcorn Hole to your conference, community, or event? Brag about it here!

Disclaimer

This is experimental software. Use at your own risk. 🌽

About

Bitcorn Hole

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.6%
  • C 2.4%