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.
- Raspberry Pi (zero W). Can be purchased here
- ssd1306 display with I2C connection (SPI would not connect with Rust crates). Can be purchased here
- 7 segment clock display. Adafruit 0.56" 4-Digit 7-Segment Display w/I2C Backpack. Can be purchased here
- or tm1637 7 segment clock display. Can be purchased here
- Misc. electronics for prototyping: bread board, wiring, multimeter etc.
- OpenSSL installed on Raspberry Pi
Label | Desc | RasPin | RasDesc |
---|---|---|---|
GND | Ground | 6 | Ground |
VCC | 3.3 V | 1 | 3.3 Volts |
SDA | I2C SDA | 3 | GPIO2 (SDA) |
SCL | I2C SCL | 5 | GPIO3 (SCL) |
Label | Desc | RasPin | RasDesc |
---|---|---|---|
GND | Ground | 6 | Ground |
VCC | 3.3 V | 1 | 3.3 Volts |
SDA | I2C SDA | 3 | GPIO2 (SDA) |
SCL | I2C SCL | 5 | GPIO3 (SCL) |
Or TM1637 display
Label | Desc | RasPin | RasDesc |
---|---|---|---|
GND | Ground | 6 | Ground |
VCC | 3.3 V | 1 | 3.3 Volts |
DIO | Data IO line | 13 | GPIO27 |
CLK | Clock line | 15 | GPIO22 |
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.
Connect led with appropriate resistor to txio/GPIO14 and ground.
sudo apt-get install libssl-dev
cargo build
or cargo build --release
./target/target/MBTA_countdown -s <station> -d <direction>
Takes over 2 hours to compile in --release on Raspberry Pi 0