Code Monkey home page Code Monkey logo

train-departure-screen's Introduction

UK train departure screen

Python script to display replica real-time UK railway station departure screens for SSD13xx devices

Sample output

Example output of the script

Requirements

To run this code, you will need Python 3.6+.

Raspbian

If you're using Raspbian Lite, you'll also need to install:

  • libopenjp2-7

with:

$ sudo apt-get install libopenjp2-7

Usage

  1. Clone this repo

  2. Install dependencies

$ pip install -r requirements.txt
  1. Sign up for the Transport API, and generate an app ID and API key

  2. Copy config.sample.json to config.json and complete the values, including your Transport API keys from step 3. Note: station names should be provided as their three-letter station code, all available here.

  3. Start the app with:

$ python ./src/main.py --display pygame --width 256 --height 64

Change the --display flag to alter the output mechanism (a list of options can be found in this README: https://github.com/rm-hull/luma.examples). Use capture to save to images, and pygame to run a visual emulator.

Remember to pass --interface spi if you are using SPI to communicate with your screen. Otherwise, the default of i2c should suffice.

$ python ./src/main.py --display ssd1322 --width 256 --height 64 --interface spi

Video demo

I've tweeted a video demo of the software running on a real device: https://twitter.com/chrishutchinson/status/1136743837244768257

Thanks

The fonts used were painstakingly put together by DanielHartUK and can be found on GitHub at https://github.com/DanielHartUK/Dot-Matrix-Typeface - A huge thanks for making that resource available!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.