Giter Site home page Giter Site logo

f451-epaper's Introduction

f451 Labs E-Paper module v0.0.0

Overview

The f451 Labs E-Paper module encapsulates the drivers for the Waveshare 2.7" e-ink display within a single class. This module also provides a standard set of methods to read sensor data and display content to the onboard 264x176 e-ink display.

Install

This module is not (yet) available on PyPi. However, you can still use pip to install the module directly from GitHub (see below).

Dependencies

This module is dependent on the following libraries:

NOTE: Only install Waveshare libraries on a device that also has the physical Waveshare e-ink display installed.

NOTE: You can run this app in demo mode on (almost) any device even without the Waveshare e-ink display. It will then save the generated images to JPG files instead of displaying them.

NOTE: When log level is DEBUG or when --debug flag is used, the output will be saved as JPGs even when the e-ink display is present.

Installing from GitHub using pip

You can use pip install to install this module directly from GitHub as follows:

Using HTTPS:

$ pip install 'f451-epaper @ git+https://github.com/mlanser/f451-epaper.git'

Using SSH:

$ pip install 'f451-epaper @ git+ssh://[email protected]:mlanser/f451-epaper.git'

TODO How to use

TODO Waveshare E-Ink Device

The SenseHat object makes it easy to interact with the Sense HAT device. The methods of this object help read sensor data, display data to the 8x8 LED, etc., and using the module is straightforward. Simply import it into your code and instantiate an SenseHat object which you can then use throughout your code.

# Import f451 Labs SenseHat
from f451_epaper.epaper import SenseHat

# Initialize device instance which includes all sensors
# and LED display on Sense HAT
mySense = SenseHat({
    "ROTATION": 0,
    "DISPLAY": 0,
    "PROGRESS": 0,
    "SLEEP": 600    
})

print(f"TEMP:     {round(mySense.get_temperature(), 1)} C")
print(f"PRESSURE: {round(mySense.get_pressure(), 1)} hPa")
print(f"HUMIDITY: {round(mySense.get_humidity(), 1)} %")

TODOHow to test

The tests are written for pytest and we use markers to separate out tests that require the actual Sense HAT hardware. Some tests do not rely on the hardware to be present. However, those tests rely on the pytest-mock module to be present.

# Run all tests (except marked 'skip')
$ pytest

# Run tests with 'hardware' marker
$ pytest -m "hardware"

# Run tests without 'hardware' marker
$ pytest -m "not hardware"

f451-epaper's People

Contributors

mlanser avatar

Watchers

 avatar  avatar

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.