Python 3 library for working with electronics
This is a python library for using electronics (like i2c or spi devices) with a unified interface. It currently supports connecting to stuff through the Raspberry Pi gpio with the i2c kernel driver and using the Bus Pirate.
First create a instance of a gateway:
from electronics.gateways import BusPirate from electronics.gateways import LinuxDevice # Use a BusPirate to connect to a bus gw = BusPirate('/dev/ttyUSB0') # Use a i2c bus with a linux driver (like the raspberry pi) gw = LinuxDevice(1) # /dev/i2c-1
Create instances for components connected to the gateway:
from electronics.devices import BMP180 from electronics.devices import MPU6050I2C barometer = BMP180(gw, address=0x77) # Address is optional inertia = MPU6050(gw) # Do chip specific initialisation barometer.load_calibration() inertia.wakeup()
Read values from sensors:
temperature = barometer.temperature() pressure = barometer.pressure() acceleration = inertia.acceleration() rotation = inertia.angular_rate()
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pyelectronics-0.1.1.tar.gz (8.0 kB)||File type Source||Python version None||Upload date||Hashes View|