/rvr2023

Controlling the Sphero RVR with a rp2040 over serial in CircuitPython using the rvr API.

Primary LanguagePythonMIT LicenseMIT

rvr2023

GitHub release MIT license

Controlling the Sphero RVR with a rp2040 over serial in CircuitPython using the rvr API.

controller board on rvr

API description

from sphero_rvr import RVRDrive
rvr = RVRDrive(uart = busio.UART(board.GP4, board.GP5, baudrate=115200))     # rp2040

rvr.drive(speed,heading)         # 0-255, -180 to 180
rvr.stop()
rvr.setMotors(left, right)       # -255 to 255
rvr.drive_to_position_si(yaw_angle, x, y, speed)
rvr.set_raw_motors(leftMode,left,rightMode,right)  # with RawMotorModes.FORWARD or .BACKWARD and int values
rvr.reset_yaw()
rvr.sensor_start()
rvr.get_x()
rvr.get_y()
rvr.get_heading()
rvr.set_all_leds()
rvr.wake()
rvr.sleep()

Full documentation at https://github.com/ssis-aa/rvr2023/blob/main/circuitpython/lib/sphero_rvr.py

Controller board with input and menu to select program

Board on the back of an Sphero RVR

128x64 sh1106 1.3 inch oled

sh1106

1.3 inch oled at thegioiic.com

TFT Pico Description
VCC VSYS Power Input
GND GND GND
A GP15 User button A -- left button (select)
B GP17 User button B -- right button (confirm)
SDA GP0 i2c data line for OLED and external sensors
SCL GP1 i2c clock for OLED and external sensors
TX GP4 TX UART 1
RX GP5 RX UART 1
TRIG GP6 trigger pin for ultrasonic
ECHO GP7 echo pin for ultrasonic

rp2040 and i2c sensors

We would like to just solder a 4-pin JST XH 2.54 mm pitch (0.1 ") connector to any of these boards and then use a standard XH-4 cable to connect to our ssis:bit without worrying about polarity or correct pin order:

connector

The order of pins in the 1mm QUIIC connector is different from the order of the 4 pins found in virtually every hobby board with 2.54mm pins:

sensors

Hopefully we soon have a little shelf with all these different sensors for 'plug and play' and a software library on our boards.

Complete pin list for SPI displays like 240x240 IPS and 320x200 3.2"

TFT Pico Description
VCC VSYS Power Input
GND GND GND
DIN GP11 MOSI pin of SPI, slave device data input
CLK GP10 SCK pin of SPI, clock pin
CS GP9 Chip selection of SPI, low active
DC GP8 Data/Command control pin (High for data; Low for command)
RST GP12 Reset pin, low active
BL GP13 Backlight control
A GP15 User button A ----- left button
B GP17 User button B ----- right button
X GP19 User button X
Y GP21 User buttonY
UP GP2 Joystick-up
DOWN GP18 Joystick-down
LEFT GP16 Joystick-left
RIGHT GP20 Joystick-right
CTRL GP3 Joystick-center
SDA GP0 i2c data line for OLED and external sensors
SCL GP1 i2c clock for OLED and external sensors
TX GP4 TX UART 1
RX GP5 RX UART 1
TRIG GP6 trigger pin for ultrasonic
ECHO GP7 echo pin for ultrasonic