Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spotpear raspi game board #479

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM python:2.7-slim
FROM python:3.12.3-slim

ARG PUBLISH_DRAFT=''

COPY . ./

Expand All @@ -7,4 +9,6 @@ RUN apt-get update && \

RUN pip install -r requirements.txt

RUN test -n ${PUBLISH_DRAFT} && ./draft/publish.sh ${PUBLISH_DRAFT}

CMD ["bash", "-c", "make serve LANG=en"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ html:
./generate-html.py $(LANG)

resources:
cp -r resources output/$(LANG)/
cp -r resources phatstack output/$(LANG)/

devel: css all resources
./serve.py ${LANG}
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ docker run -p 5000:5000 -e PINOUT_LANG=en pinout.xyz

Now you can access the webserver at http://127.0.0.1:5000.

Optionally you can include a draft board in the containerized webserver by setting the `PUBLISH_DRAFT` build argument:

```bash
docker run -p 5000:5000 -e PINOUT_LANG=en --build-arg PUBLISH_DRAFT=myboard pinout.xyz
```

# Translating

If you would like to provide support for a language not yet in the repository you should start by duplicating the `src/en` directory to the appropriate [language-code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). For example, if you want to create a Czech translation you would create the folder `src/cs`. Note that there are no plans to support cultures (it would just get out of hand), so you can't have `src/fr-CA` (sorry!).
Expand Down
Binary file added draft/boards/spotpear-raspberry-pi-game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions draft/overlay/spotpear-raspberry-pi-game.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!--
---
name: Spotpear Raspberry Pi Game
class: board
type: display,audio
formfactor: pHAT
manufacturer: Spotpear
description: Game controller with 1.3inch LCD, buttons, speaker and audio out
url: https://spotpear.com/index/product/detail/id/1494.html
buy: https://spotpear.com/index/product/detail/id/1494.html
schematic: https://cdn.static.spotpear.com/uploads/picture/learn/raspberry-pi/raspberry-pi-game/Pi-1.3inch-LCD-audio-3d/RPi-1.3inch-MINI-LCD.pdf
image: 'spotpear-raspberry-pi-game.png'
pincount: 40
eeprom: no
power:
'1':
'2':
'4':
'17':
ground:
'6':
'9':
'14':
'20':
'25':
'30':
'34':
'39':
pin:
'8':
name: Button Trigger Right
'10':
name: Button X
'16':
name: Button Trigger Left
'29':
name: Button D-Pad Up
'31':
name: Button D-Pad Down
'32':
name: Button Y
'33':
name: Button D-Pad Right
'35':
name: Button Select
'36':
name: Button D-Pad Left
'37':
name: Button Start
'38':
name: Button B
'40':
name: Button A
'12':
name: Audio PWM
'13':
name: LCD Reset
'22':
name: LCD Data/Command
'19':
name: LCD SPI MOSI
'23':
name: LCD SPI SCLK
mode: SPI
'24':
name: LCD SPI CS
mode: SPI
-->
# Raspberry Pi Game

1.3" LCD with inbuilt 3 watt speaker, headphone out and game controller buttons (Start, Select, D-pad, A, B, X, Y and L/R trigger buttons)

## Features

* 240x240 LCD (ST7789V driver)
* 3W speaker
* 3.5mm headphone output
* 12 game controller buttons
4 changes: 4 additions & 0 deletions serve.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

import sys
import os

try:
from flask import Flask, send_from_directory
Expand All @@ -25,6 +26,9 @@ def custom_static(filename):

@app.route("/<path:page>")
def show_page(page):
if not os.path.exists('{}/{}.html'.format(basedir, page)):
page = page + '/index'

return send_from_directory(basedir, '{}.html'.format(page))


Expand Down