https://github.com/adygcode/trafficlights-2021-s2
https://github.com/adygcode/trafficlights-2021-s2
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/adygcode/trafficlights-2021-s2
- Owner: AdyGCode
- Created: 2021-08-17T05:59:18.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-17T09:01:26.000Z (almost 5 years ago)
- Last Synced: 2026-01-01T21:52:23.410Z (6 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TRaffic Lights
This short bit of code serves the following purposes:
- Illustrating the idea classes and inheritance
- Illustrating the use of methods
- Illustrating the use of instance variables
## Requirements
This code requires either:
- Raspberry Pi + SenseHAT, or
- SenseHAT simulator (https://trinket.io/sense-hat), or
- Raspberry Pi Simulator + SenseHAT simulator ()
- Raspberry Pi + SenseHAT simulator ()
### Pi & SenseHAT (Physical hardware)
Docs: [...](#)
A Raspberry PI with a SenseHAT will need to have the SenseHAT support files installed:
```shell
sudo apt-get update
sudo apt-get install sense-hat
sudo pip3 install pillow
```
### SenseHAT simulator (Runs on Web)
Docs: [https://sense-emu.readthedocs.io](https://sense-emu.readthedocs.io)
You will need to create a `main.py` and a `TrafficLight.py` file and put the required code into the respective files.
### Raspberry Pi (Physical) and SenseHAT Emulator
Docs: [https://sense-emu.readthedocs.io](https://sense-emu.readthedocs.io)
If you wish to run the SenseHAT emulator on the Raspberry Pi, then you will need to do the following:
- Install the emulator
```shell
sudo apt-get update
sudo apt-get install python-sense-emu python3-sense-emu sense-emu-tools
```
Any references to `sense_hat` will be replaced by `sense_emu`. For example:
```python
from sense_emu import SenseHat
```
### Raspberry PI and SenseHAT simulator (Both emulated)
*Details to come...*
Docs: [...](#)