This library enables usage of some sensors and actors of the Joy-Pi Advanced on the Raspberry Pi.
Project description
Joy-Pi Advanced Library for Raspberry Pi
This library is a collection for the Raspberry Pi for several modules on the Joy-Pi Advanced. See here for more information.
Included modules
This library includes the following modules:
- ADC
- Gyroscope
- Barometer
- Button Matrix
- Color Sensor
- LED Matrix
- Servo Motor
- Stepper Motor
[!WARNING] The Joy-Pi Advanced 2 is no longer compatible with this library for the LED Matrix. To ensure compatibility with the Raspberry Pi 5, the LED matrix is now controlled via I²C because of the RP2040 microcontroller chip. The LED matrix can now be controlled with the Joy-Pi Advanced via this repository.
Dependencies
This library has some dependencies which are used to control the modules of the Joy Pi Advanced. To use this library, you will need to install the following dependencies:
rpi_ws281x- for the LED matrix - withpip install rpi_ws281xAdafruit CircuitPython BusDevice- for the barometer - withpip install adafruit-circuitpython-busdeviceAdafruit_CircuitPython_MCP230xx- for the button matrix - withpip install adafruit-circuitpython-mcp230xx
Installation
pip install JoyPi_Advanced_RaspberryPi
Library Guide
ADC
adc(bus = 0, device = 0)- initialize ADC with default valuesopen()- starts communicationread_value(channel)- returns raw value from a selected channelread_voltage(channel, value=None)- returns measured voltage from a selected channel, raw value can also be calculated into voltage with this methodclose()- ends communication
Gyroscope
gyroscope(bus = 0, device = 2)- initialize gyroscope with default valuesopen()- starts communicationclose()- ends communicationgetTemperature()- returns measured temperaturegetTilt()- returns the tilted directionscale_Factor(scale)- sets scale factor of the gyroscope (0, 8, 16 or 24)
Barometer
barometer(i2c: busio.I2C, i2c_address = 0x77, resolution=4096)- initialize barometer with default valuesget_pressure()- returns the measured pressureget_temperature()- returns the measured temperatureget_altitude(reference_pressure = 1013.25)- return the calculated altitude with the measured pressure and your local pressure (reference_pressure)
Button matrix
buttonmatrix(i2c: busio.I2C, i2c_address = 0x22)- initialize button matrix with default valuesgetKey()- returns the pressed buttonclearMemory()- clears class variablecalculatedcalculate()- method to use the button matrix as a calculator
Color sensor
colour(i2c_address = 0x10)- initialize colour sensor with default valuesenableSensor()- start communicationdisableSensor()- end communicationgetRGBW()- returns measured RGBW valuessetIntegrationTime()- set integration time (0-40ms,1-80ms,2-160ms,3-320ms,4-640ms or5-1280ms)forceMode()- forces measurement modeautoMode()- automatic measurement modereadAll()- returns RGB colours as well as raw values
LED matrix
LEDMatrix( pin = 18, brightness = 100)- initialize LED matrix with default valuesclean()- clears the LED matrixsetPixel(position, colour)- sets specific pixel to a selected colourRGB_on(colour)- sets the complete matrix to one selected colourrainbow(wait_ms=20, iterations=1)- rainbow effect on the whole matrix with default valuescolourWipe(colour, wait_ms=50)- Move selected colour pixel by pixel onto the matrix with default speedtheaterChase( colour, wait_ms=50, iterations=10)- chaser animation with a selected colour with deafult speedshow()- displays set pixelsdemo1()- demo program version 1demo2()- demo program version 2
Servo motor
servomotor(pin = 18, position = 0)- initialize servo motor with default valuessetDirection(set_pos, speed = 5)- moves servomotor to a selected position in specified speed (1-5 : slowest - fastest)setPosition(pos)- moves servomotor to a selected position with default speedsetHome()- sets servomotor to start positiongetPosition()- returns position of servo motorend()- moves servo into start position, stops communication and cleans up communication
Stepper motor
stepmotor(pin1 = 22, pin2 = 23, pin3 = 24, pin4 = 4)- initialize step motor with default valuesturnSteps(steps)- turns a selected amount of stepsturnDegrees(deg)- turns a selected amount of degreeturnDistance(dist, rad)- rotates by distance valueclose()- close all used pins
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file joypi_advanced_raspberrypi-2.0.0.tar.gz.
File metadata
- Download URL: joypi_advanced_raspberrypi-2.0.0.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fd1492c059708207e09d5169c8b62b843c6dee9c066ad64a64c20434c9a6662
|
|
| MD5 |
0d9aa9e7770925b10ed09f44b1adf7d1
|
|
| BLAKE2b-256 |
b07d587d057348d041fd6f31dd9fa2f29f9d153b13ea0304900b7e7a3541636e
|
File details
Details for the file joypi_advanced_raspberrypi-2.0.0-py3-none-any.whl.
File metadata
- Download URL: joypi_advanced_raspberrypi-2.0.0-py3-none-any.whl
- Upload date:
- Size: 25.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4567d7d99410e9947fb90ba57fe3123e5931c01b418e070fc36dd87bcf86e31
|
|
| MD5 |
910f8afda76d2b6ad639edf6fe631adf
|
|
| BLAKE2b-256 |
10c0a1d54b51a0ea0ff3188776ba6bae0506d78d14cd8d19285a38f1daa71dd2
|