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
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
Metadata
Release files for JoyPi-Advanced-RaspberryPi 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| joypi_advanced_raspberrypi-2.0.2.tar.gz | 24.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| joypi_advanced_raspberrypi-2.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 50.6 kB
Release files / joypi_advanced_raspberrypi-2.0.2.tar.gz
| Download URL | joypi_advanced_raspberrypi-2.0.2.tar.gz |
|---|---|
| Size | 24.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3dedacef1abff2c50870d99b4ef24db5af21d9969dcf9fe0dee05f7857965d31
|
|
BLAKE2b-256 checksum How to use checksums |
de4344ab39f1787636b160b4e453d0013cccc54baf197356ee8aac5698887b4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / joypi_advanced_raspberrypi-2.0.2-py3-none-any.whl
| Download URL | joypi_advanced_raspberrypi-2.0.2-py3-none-any.whl |
|---|---|
| Size | 25.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53a8ff945a87b8ab7c97f90afa8db9f08cefc32c0da91001f920beab97712579
|
|
BLAKE2b-256 checksum How to use checksums |
6272e141fad88cd46087fbda3bc1c3669182e8e4350873b114a5218926ee9165
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|