/rgb_stonks

A stonk ticker for an RGB Matrix

Primary LanguagePython

rgb_stonks

An LED stock ticker based on the rpi-rgb-led-matrix from hzeller

Requires a Raspberry Pi and an LED board hooked up via the GPIO pins.

Installing the software

This installation process will take about 10-15 minutes. Raspberry Pis aren't the fastest of computers, so be patient!

git clone --recursive https://github.com/twfarley/rgb_stonks
cd rgb_stonks/
sudo ./install.sh

This will install the rgbmatrix binaries, which we get from another open source library. It controls the actual rendering of the ticker onto the LEDs. If you're curious, you can read through their documentation on how all of the lower level stuff works.

Usage

sudo python stonks.py Running as root is 100% an absolute must, or the matrix won't render.

Adafruit HAT/Bonnet users: You must supply a command line flag:

sudo python main.py --led-gpio-mapping="adafruit-hat"

See the Flags section below for more flags you can optionally provide.

Flags

You can configure your LED matrix with the same flags used in the rpi-rgb-led-matrix library. More information on these arguments can be found in the library documentation.

--led-rows                Display rows. 16 for 16x32, 32 for 32x32. (Default: 32)
--led-cols                Panel columns. Typically 32 or 64. (Default: 32)
--led-chain               Daisy-chained boards. (Default: 1)
--led-parallel            For Plus-models or RPi2: parallel chains. 1..3. (Default: 1)
--led-pwm-bits            Bits used for PWM. Range 1..11. (Default: 11)
--led-brightness          Sets brightness level. Range: 1..100. (Default: 100)
--led-gpio-mapping        Hardware Mapping: regular, adafruit-hat, adafruit-hat-pwm
--led-scan-mode           Progressive or interlaced scan. 0 = Progressive, 1 = Interlaced. (Default: 1)
--led-pwm-lsb-nanosecond  Base time-unit for the on-time in the lowest significant bit in nanoseconds. (Default: 130)
--led-show-refresh        Shows the current refresh rate of the LED panel.
--led-slowdown-gpio       Slow down writing to GPIO. Range: 0..4. (Default: 1)
--led-no-hardware-pulse   Don't use hardware pin-pulse generation.
--led-rgb-sequence        Switch if your matrix has led colors swapped. (Default: RGB)
--led-pixel-mapper        Apply pixel mappers. e.g Rotate:90, U-mapper
--led-row-addr-type       0 = default; 1 = AB-addressed panels. (Default: 0)
--led-multiplexing        Multiplexing type: 0 = direct; 1 = strip; 2 = checker; 3 = spiral; 4 = Z-strip; 5 = ZnMirrorZStripe; 6 = coreman; 7 = Kaler2Scan; 8 = ZStripeUneven. (Default: 0)

Sources

This project relies on this library: rpi-rgb-led-matrix is the library used for making everything work with the LED board and is included as a submodule, so when cloning, make sure you add --recursive.