Image HAT
Project description
Image HAT
Installation
Install dependencies
The python3-smbus package
$ sudo apt install python3-smbus
Install using pip
$ sudo pip3 install -U imagehat
Listing attributes and methods
#!/usr/bin/env python3
from imagehat import *
hat = ImageHat(0x20) # 0x20 is the I2C bus address
hat.host # get selected host
hat.host = 0 # unplug USB device
hat.host = 1 # switch USB device to host 1
hat.host = 2 # switch USB device to host 2
hat.usb_power # get state of USB device power supply
hat_usb_power = 0 # turn off USB device power supply
hat.usb_power = 1 # turn on USB device power supply
hat.host2_in # get USB power state of host 2
hat.ext_in # get state of external input
hat.ext_out # get state of external output
hat.ext_out = 0 # turn off external output
hat.ext_out = 1 # turn on external output
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
imagehat-0.0.12.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for imagehat-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4d0284290079f6e22ad431da8a4a53b9e56678faaf9e75d1a83ff6f8082246b |
|
MD5 | c250de585b675c34504bb3b58a217483 |
|
BLAKE2b-256 | 54127124df782ec39919f739d7e42eb9005022c96469d95ac13d73a5e3ad1930 |