change rpi pins

This commit is contained in:
ohsqueezy 2023-01-27 17:22:06 -05:00
parent 6231711a3d
commit 941c320290
4 changed files with 16 additions and 16 deletions

4
NS.py
View File

@ -6,9 +6,9 @@
# the hardware. For more information on setting up and running the game, see
# README.md, or for the game in general, visit <https://scrape.nugget.fun/>.
#
# Full open source code is available at <https://open.shampoo.ooo/scrape/scrapeboard>.
# The code, assets, and hardware are released as open source. See <https://open.shampoo.ooo/scrape/scrapeboard>.
#
# This is the main file containing all the pygame code.
# This is the main file containing all the Pygame code.
import argparse, pathlib, operator, subprocess, sys, os

View File

@ -8,11 +8,11 @@ So, you think you can skateboard, but can you scrapeboard, you slime bag? Scrape
Controller
----------
The standard controller is a custom platform combined with a modified skatedeck, seen in the above GIF. It can be built using the instructions in the [builder's manual][]. Custom interfaces can also be created using an Arduino or Raspberry Pi. There is also keyboard support built-in. It is meant for testing, but the game can be played with it.
The standard controller is a custom platform combined with a modified skatedeck, seen in the above GIF. It can be built using the instructions in the [builder's manual][1]. Custom interfaces can also be created using an Arduino or Raspberry Pi. There is also keyboard support built-in. It is meant for testing, but the game can be played with it.
The hardware requirement for [serial mode](#Serial) is an [Arduino][] or Arduino-equivalent device that can run the [serial program][]. [Raspberry Pi][] mode is similar to serial mode, but it uses the Python GPIO library to get input directly from the Raspberry Pi pins. For [keyboard mode](#Keys), no special hardware is required, although a gamepad or [Makey Makey][] could be used to create a custom controller that sends key presses.
See [Scrapeboard Builder's Manual][] for detailed instructions on how to build a complete system from scratch using an Arduino or Raspberry Pi!
See [Scrapeboard Builder's Manual][1] for detailed instructions on how to build a complete system from scratch using an Arduino or Raspberry Pi!
Software
--------
@ -52,12 +52,12 @@ The Arduino must be loaded with the [serial program][] and connected to USB. The
If you don't have the board, pad and Arduino, you can test the game using keyboard-only mode.
Refer to [Scrapeboard Builder's Manual][] for how to build the circuit.
Refer to [Scrapeboard Builder's Manual][2] for how to build the circuit.
Raspberry Pi
------------
Raspberry Pi GPIO input is also supported. Refer to [Scrapeboard Builder's Manual][] for how to build the circuit. Once the circuit is in place, the game will be able to detect GPIO input. Run with the `--pi` flag to activate Raspberry Pi mode.
Raspberry Pi GPIO input is also supported. Refer to [Scrapeboard Builder's Manual][2] for how to build the circuit. Once the circuit is in place, the game will be able to detect GPIO input. Run with the `--pi` flag to activate Raspberry Pi mode.
./OPEN-GAME --pi
@ -118,6 +118,8 @@ Send us a donation through [Ko-fi](https://ko-fi.com/scrapeboard)!
[![Donate at Ko-fi](https://storage.ko-fi.com/cdn/kofi3.png?v=3)](https://ko-fi.com/Z8Z7FX41L)
[1]: Scrapeboard_Builder's_Manual.md
[2]: Scrapeboard_Builder's_Manual.md#Electronics
[Pygame]: https://pygame.org
[Makey Makey]: https://makeymakey.com
[serial program]: serial/serial.ino
@ -127,5 +129,3 @@ Send us a donation through [Ko-fi](https://ko-fi.com/scrapeboard)!
[LICENSE.txt]: LICENSE.txt
[PGFW]: https://git.nugget.fun/nugget/pgfw
[Raspberry Pi]: https://www.raspberrypi.org/
[Scrapeboard Builder's Manual]: Scrapeboard_Builder's_Manual.md
[builder's manual]: Scrapeboard_Builder's_Manual.md

View File

@ -317,7 +317,7 @@ Four input pins on the microcontroller need to be connected to the game's four i
#### Raspberry Pi
1. Connect pins 11, 13, 15, and 16 to the breadboard using jumper wires (these pins are also referred to as GPIO 17, GPIO 27, GPIO 22, and GPIO 23).
1. Connect pins 37, 35, 33, and 31 to the breadboard using jumper wires (these pins are also referred to as GPIO 26, GPIO 19, GPIO 13, and GPIO 6).
2. Extend each connection using a 4.7k ohm resistor
3. End each connection with a screw terminal
@ -371,7 +371,7 @@ The electronics are assumed to be installed in front of the platform, near where
To avoid confusion between similar parts, the following terms are used:
* *Platform*: the entire floor device, containing four metal plates
* *Platform*: the entire floor device, containing four panels
* *Panel*: a single piece of the four panel platform, a piece of wood with a single metal plate attached
* *Plate*: the metal part of the panel by itself
* *Pad*: one of the two metal anchor rings on the underside of the scrapeboard
@ -438,7 +438,7 @@ The metal plates need to be screwed into the platform, leaving the measured cros
4. Pre-drill a hole for each screw through the metal and into the wood at each mark. For the wire hole, pre-drill into the wood under the hole. If using machine screws on the inner edges, these holes should go all the way through the wood and out the underside. If the channels were routed correctly, each hole will emerge in the center of its channel on the underside. For any holes not using machine screws, the pre-drill holes do not need to go deep into the wood.
5. Screws that stick out of the metal can catch the round metal pads of the scrapeboard when it scrapes over them, causing the metal to pry out. Because of that, countersinking should be done on the two inner edges of each plate before drilling in the screws. This will allow the screw heads to be drilled flush with the panel. If the metal plate is thin, the countersink should be on the wood under the plate, so the metal itself will sink into the hole. If the metal is thick, ideally as thick as the screw head, the countersink should be on the metal, so the screw head will drill flush with the metal. If using a countersink bit, insert it into the drill and create a countersink at each previously drilled hole that matches the size of the screw heads. If not using a countersink bit, use a large drill bit to simulate a countersink bit and drill a shallow hole on top of the previously drilled holes.
6. Insert a screw into each non-wire hole and drill it in.
7. The contact part of the wire should still be sticking out through its hole from under the metal plate. Place a washer over the hole, with the wire under it. Place a screw in the pre-drilled hole in the wood. Screw in the screw a bit, then wrap the wire around the screw under the washer. Drill the screw in fully. The wire should now be clamped tightly between the washer and the metal plate.
7. The contact part of the wire should still be sticking out through its hole from under the metal plate. Place a washer over the hole, with the wire under it. Place a screw in the pre-drilled hole in the wood. Screw in the screw a bit, then wrap the wire clockwise around the screw under the washer. Drill the screw in fully. The wire should now be clamped tightly between the washer and the metal plate.
#### Brackets
@ -466,7 +466,7 @@ The non-slip padding is necessary on many surfaces to keep the platform from sli
The platform is now finished. It can be connected to the Arduino or Raspberry Pi and tested before moving on to building the board.
1. Carefully flip the platform back over, taking care near the seams because the underside bracketing can make it susceptible to snapping.
2. For each wire, insert its far end into its appropriate screw terminal. Going clockwise from the top left plate, for Arduino, the wires connect to pins 2, 4, 6, and 11. For Raspberry Pi, the wires connect to pins 11, 13, 15, and 16.
2. For each wire, insert its far end into its appropriate screw terminal. Going clockwise from the top left plate, for Arduino, the wires connect to pins 2, 3, 4, and 5. For Raspberry Pi, the wires connect to pins 37, 35, 33, and 31 (also known as GPIO 26, GPIO 19, GPIO 13, GPIO 6).
3. Use any metal conductor to touch one metal plate to another. The lizard should appear on the screen.
### Scrapeboard

View File

@ -19,10 +19,10 @@ import RPi.GPIO as GPIO
# These represent the game pads and the GPIO pins they're connected to
LNW, LNE, LSE, LSW = range(4)
pins = {
LNW: 17,
LNE: 27,
LSE: 22,
LSW: 23
LNW: 26,
LNE: 19,
LSE: 13,
LSW: 6
}
def initialize_gpio():