2022-12-29 21:11:05 +01:00
|
|
|
# 1D-pong
|
|
|
|
|
|
|
|
This is an ESP32 (at least that) version of the all well known warareg 1-D Pong game
|
|
|
|
also known as `one_d_pong`.
|
|
|
|
|
|
|
|
This is a linear pong game where the bat is a home area of about 7 pixels. Depending on
|
|
|
|
how deep you let the ball run into your home area, the faster it is repelled. If you
|
|
|
|
fail to press the button in time you loose a point since the ball enters your home.
|
|
|
|
This version supports a boost button which sacrefies one pixel of your home area in
|
|
|
|
favor of boosting your ball faster.
|
|
|
|
|
2023-03-12 22:53:40 +01:00
|
|
|
![Full 1D-pong device](doc/leiste.jpg)
|
2023-03-12 14:56:32 +01:00
|
|
|
|
2023-03-13 15:51:19 +01:00
|
|
|
We discovered that using these Pins for I/O was a good choice
|
2023-03-08 22:34:58 +01:00
|
|
|
|
2023-03-13 15:51:19 +01:00
|
|
|
* GPIO21 = LED data (WS2812b)
|
2023-03-08 22:34:58 +01:00
|
|
|
* GPIO19 = Right start/hit button (Y)
|
|
|
|
* GPIO18 = Right power-up button (Y)
|
|
|
|
* GPIO33 = Left start/hit button (X)
|
|
|
|
* GPIO23 = Left power-up button (X)
|
|
|
|
* SOUND GPIO32 = Buzzer output (PB1/OC1A)
|
|
|
|
|
|
|
|
Some pins do not allow to configure Pull up resistors or work only as output. Don't use them.
|
|
|
|
|
2023-03-12 22:53:40 +01:00
|
|
|
![The ESP32 of that shape with Pins connected](doc/µc.jpg)
|
2023-03-12 14:56:32 +01:00
|
|
|
|
2023-03-08 22:34:58 +01:00
|
|
|
We used Mouse devices which where re-soldered to use the 4 USB wires as 'short to GND' to work as controllers.
|
2023-03-13 15:51:19 +01:00
|
|
|
That is, each button got explicitly one of the Din, Dout, Vcc wires and shorts it to the GND wire of USB.
|
|
|
|
USB plugs where of course snipped off.
|
2023-03-13 15:21:32 +01:00
|
|
|
We also did re-solder some of the existing capacitors of the USB-logic board and put them in parallel to the
|
|
|
|
switch to suppress electric bouncing of the switch signal.
|
2023-03-08 22:34:58 +01:00
|
|
|
|
2023-03-12 22:53:40 +01:00
|
|
|
One way of wiring everything up (you can vary for geometry reasons) can be seen here.
|
|
|
|
We respected the types of PINs and their capability. i.e. all switch pins must support
|
2023-03-13 15:21:32 +01:00
|
|
|
pull up resistors (configurable property of ESP32) and work as digital input.
|
|
|
|
The buzzer sound pin must be supported by the PWM generator. (Not yet used by the code)
|
2023-03-12 22:53:40 +01:00
|
|
|
|
|
|
|
![Layout](doc/Verdrahtung_Steckplatine.png)
|