Skip to content

Roco-scientist/MBTA_countdown

Repository files navigation

MBTA countdown

This program creates two displays. One display counts down until the next arrival of the MBTA train/subway while the other screen displays the arrival time. Created in order to not miss a commuter rail train but expanded to include the subway.

Requirements

Connections

Screen display

LabelDescRasPinRasDesc
GNDGround6Ground
VCC3.3 V13.3 Volts
SDAI2C SDA3GPIO2 (SDA)
SCLI2C SCL5GPIO3 (SCL)

Clock display

https://learn.adafruit.com/adafruit-led-backpack/0-dot-56-seven-segment-backpack-python-wiring-and-setup

LabelDescRasPinRasDesc
GNDGround6Ground
VCC3.3 V13.3 Volts
SDAI2C SDA3GPIO2 (SDA)
SCLI2C SCL5GPIO3 (SCL)

Or TM1637 display
LabelDescRasPinRasDesc
GNDGround6Ground
VCC3.3 V13.3 Volts
DIOData IO line13GPIO27
CLKClock line15GPIO22

Shutdown button (optional)

Required: Momentary switch
Connect GPIO pin 13 through a momentary switch to a 3.3V source. Add a couple hundred ohm resistor to prevent over voltage to pin 13. Pressing the momentary switch will cleanly shutdown the program then shutdown the raspberry pi.

Power led (optional)

Connect led with appropriate resistor to txio/GPIO14 and ground.

How to run

sudo apt-get install libssl-dev
cargo build or cargo build --release
./target/target/MBTA_countdown -s <station> -d <direction>

WARNING

Takes over 2 hours to compile in --release on Raspberry Pi 0  ""