Skip to main content

Raspberry Pi library for interaction with a chain of a particular SegM8 7-segment indicator modules.

Project description

SegM8Pi

Raspberry Pi library for interaction with a chain of a particular SegM8 7-segment indicator modules.

Enable SPI Interface

If you haven’t enabled SPI support in your Raspbian Linux yet, open the terminal and run the following commands:

  1. Run sudo raspi-config.
  2. Use the down arrow to select 5 Interfacing Options.
  3. Arrow down to P4 SPI.
  4. Select <Yes> when it asks you to enable SPI.
  5. Press <Ok> when it tells you that SPI is enabled.
  6. Use the right arrow to select the <Finish> button.
  7. Reboot your Raspberry Pi to make the SPI interface appear.

After reboot, log in and enter the following command:

$ ls /dev/spi*

The Pi should respond with:

/dev/spidev0.0  /dev/spidev0.1

These represent SPI devices on chip enable pins 0 and 1, respectively. These pins are hardwired within the Pi.

Installation

Use pip to install the library:

pip3 install segm8

Quickstart example

import time
import segm8

# Create an object for working with the Segm8 module.
segm8_module = segm8.SegM8(0, 1)

# Display numbers from 0 to 9.
for number in range(10):
    segm8_module.display_int(number, 0, 1)
    time.sleep(1)

# Clear all segments of the module.
segm8_module.clear()
time.sleep(1)

message = "End"
# Display each letter in the message.
for letter in message:
    segm8_module.display_string(letter, 0, 1)
    time.sleep(1)

See full API reference in API.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

segm8-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file segm8-1.0.0.tar.gz.

File metadata

  • Download URL: segm8-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for segm8-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b70e51261e6ab592672d9b0e04fe6b4e6a4b1c271ff8ed5daa3b2264f2105e40
MD5 620933fcb63d2e43aee3393d95756c98
BLAKE2b-256 170693f7c84f7cf64e9f76da5855716fa2c119de83bc670445adf7ffc6a1f97d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page