lekum / randomtale-api

This repo is designed to run on a Raspberry Pi with audio playback (used with pimoronis Speaker pHAT) and a lightsensor wired up on top of the shield (see schematics).

Home Page:https://medium.com/@joranquinten/the-tinkering-fairy-tale-a579f0b30b0e

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RandomTale Light Sensitive Playback

This repo is designed to run on a Raspberry Pi with audio playback (used with pimoronis Speaker pHAT) and a lightsabersensor wired up on top of the shield (see schematics).

Tried and tested with (not included in this repo):

All Python dependencies should be available preinstalled on a Raspberry Pi. It uses the RPi library to address the pins and pygame library to handle playback.

Wiring schema

The script assumes the schema as shown below. For identifying pins on the Raspberry Pi, take a look at pinout.xyz. This config doesn't interfere with the pins reserved for the speaker shield.

On switch

RaspPi Pin RaspPi function
5 GPIO 3
6 GND

Off switch

RaspPi Pin RaspPi function
36 GPIO 16
34 GND

Light sensor

Sensor RaspPi Pin RaspPi function
GND 20 GND
VCC 17 3.3v
SIGNAL D0 19 GPIO 10

Getting Started

  • Clone the repo to your pi
  • Make sure there's an /input/ folder with *.mp3s on the root level
    • The script just tries to play a random file from the folder, so only place media files over here!

Then run the script:

python start.py

Want it to start up the script automagically? Take a look at these instructions

How to contribute to this project

  • Fork this repository (Click the Fork button in the top right of this page, click your Profile Image)
  • Clone your fork down to your local machine
git clone https://github.com/your-username/randomtale-api.git
  • Create a branch
git checkout -b branch-name
  • Make your changes (choose from any task below)
  • Commit and push
git add .
git commit -m 'Commit message'
git push origin branch-name
  • Create a new pull request from your forked repository (Click the New Pull Request button located at the top of your repo).

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

This repo is designed to run on a Raspberry Pi with audio playback (used with pimoronis Speaker pHAT) and a lightsensor wired up on top of the shield (see schematics).

https://medium.com/@joranquinten/the-tinkering-fairy-tale-a579f0b30b0e


Languages

Language:Python 98.2%Language:Shell 1.8%