Skip to content

PiBody Documentation

Welcome to the PiBody documentation site.

PiBody is an educational microcontroller board based on the Raspberry Pi Pico W, programmed in MicroPython. This site documents the pibody package — the firmware library that provides a high-level API for all onboard and pluggable peripherals. artisan.education

Modules

Modules Description
Input (Analog)
pibody.LightSensor Analog input ADC (read a light sensor)
pibody.Potentiometer Analog input ADC (read a potentiometer state)
Input (Digital)
pibody.MotionSensor Digital input pin (read a motion sensor)
pibody.Button Digital input pin (read a button)
pibody.Switch Digital input pin (read a switch)
pibody.TouchSensor Digital input pin (read a touch sensor)
Input (I2C)
pibody.ClimateSensor Temperature, humidity and pressure
pibody.ColorSensor RGBW colour sensor
pibody.DistanceSensor Time-of-flight distance sensor
pibody.GyroAccel IMU (accelerometer + gyroscope)
Input
pibody.Joystick 2-axis analogue joystick
pibody.Encoder Rotary encoder
pibody.SoundSensor Sound detector (analogue + digital outputs)
Output
pibody.LED Digital output pin (drives an LED)
pibody.Buzzer Piezo buzzer / speaker
pibody.LEDTower Addressable RGB LED strip
pibody.Display 320×240 LCD display
pibody.Servo RC servo motor
pibody.PWM Pulse-width modulation output (LED dimming, servo control)
IOT
pibody.WiFi WiFi manager
pibody.TelegramBot Telegram bot API client

Quick start

from pibody import LED

led = LED("A")    # LED on slot A
led.on()          # turn on
led.off()         # turn off
from pibody import Button

btn = Button("B")      # Button on slot B
if btn.value() == 1:   # read
    print("pressed!")

Documentation source: pibody_libs — original source library of PiBody.