This lab provides code to test all aspects of your mouse and identify any hardware defects. If at any point in this lab a test is not passed, ask an instructor for help debugging.
-
Plug mouse into your computer and upload the latest firmware.uf2 (see releases by dragging the file into the
RPI-RP2
folder that shows up. It should disappear and reappear as aCIRCUITPY
folder.- If you've uploaded firmware before, you'll need to hold the
BOOTSEL
button on the Pi Pico while plugging in.
- If you've uploaded firmware before, you'll need to hold the
-
Download the latest CircuitPython libraries (Bundle for Version 7.x) and upload the following ones to the lib/ folder on your mouse.
- adafruit_motor/
- adafruit_onewire/
- neopixel.mpy
-
Upload the contents of sanity/ to the CircuitPython drive that shows up when you plug your mouse into your computer.
-
Find the associated serial port for your mouse.
Windows
Open up
Device Manager
and check thePorts (COM & LPT)
dropdown. Your serial (COM) port is one of those. If it's hard to identify, try unplugging and replugging your mouse and see which COM port disappears.MacOS
Run
ls /dev/tty.*
in Terminal. The correct port is one of those. If it's hard to identify, try unplugging and replugging your mouse and see which port disappears.Linux
Hello there! A fellow power user you are. Your distro may be different, but chances are it's under something like
/dev/ttyACM0
. -
Bring up a serial monitor on that serial port (baud rate doesn't matter). There are many options of software to use, but the following are what I personally use.
- Windows - PuTTY
- MacOS - SerialTools and screen
- Linux - screen
-
Follow the instructions printed to the serial monitor. You may have to press CTRL-C and CTRL-D to reset if you don't see anything.
- IR sensor readings should be around 30,000-60,000 without a surface in front of them and under 5,000 with your hand right in front of them.
- Encoders should be ~217 ticks per revolution.