Rapturezone

  • Resources
  • Blog
  • About Us
  • Privacy Policy

Pi Pico Mouse Jiggler

July 22 by www

Pi Pico Mouse Jiggler

  • Requirements
  • Setup
    • Install Circuit Python
    • Install Thonny
      • Setup Thonny
  • Write Code
  • Related
  • Links

Requirements

  • Raspberry Pi Pico
  • Micro USB Male to USB A male cable
  • Circuit Python
  • Thonny Application

Setup

Install Thonny Onto Workstation

sudo apt install thonny -y

Install Circuit Python Onto Raspberry Pi Pico

  • Download Circuit Python U2F file from https://circuitpython.org/board/raspberry_pi_pico/
  • Hold down the Boot Sel button on the Raspberry Pi Pico and plug it into the workstation
  • Release the Boot Sel button
  • Drag and Drop the U2F file into the Raspberry Pi Pico Storage (The Raspberry Pi will reboot)

Setup the Thonny Environment

  • Open Thonny
  • Tools>Options>Interpreter>Circuit Python Generic>OK

Install HID Library via Thonny

  • Tools>Manage Plugins>Manage Packages>Search: adafruit_hid
  • adafruit-circuitpython-hid>Install

If you get an error like

Installing to temp directory
Error installing 'adafruit-circuitpython-hid': b'403'
Installing to: /tmp/tmpz8124mnw/
micropip returned with error code 1

Try the manual method

Install HID Library Manually

  • Download https://github.com/adafruit/Adafruit_CircuitPython_HID/archive/refs/heads/main.zip
  • extract: /Adafruit_CircuitPython_HID-main/adafruit_hid/
  • copy above folder “adafruit_hid”
  • into: /media/username/CIRCUITPY/lib/

Write the Code

from adafruit_hid.mouse import Mouse
import board
import digitalio
import time
import usb_hid

mouse = Mouse(usb_hid.devices)

led = digitalio.DigitalInOut(board.GP25)
led.direction = digitalio.Direction.OUTPUT

led.value = False
time.sleep(5)

while True:
	led.value = True
	mouse.move(x=2)
	led.value = False
	time.sleep(0.5)
	led.value = True
	mouse.move(x=-3)
	led.value = False
	time.sleep(0.5)
File>Save /code.py

Overwrite?: Do you want to overwrite ‘code.py’ ?

[Yes]

Disabling Storage Device

By default when you plug in the CircuitPython Pi Pico it mounts as a USB mass storage device called CIRCUITPY.
This can be undesirable. As of CircuitPyton 7 boot.py is now supported.
https://learn.adafruit.com/customizing-usb-devices-in-circuitpython

Related

  • How to make a Shortcut open with a Specific Browser

Links

  • https://www.raspberrypi.org/products/raspberry-pi-pico/

Filed Under: Uncategorized Tagged With: Hardware, Python

Recent Posts

  • Alternative Android Apps
  • Web Scraping with Python and Beautiful Soup Example IMDB Top 250
  • Web Scraping with Python and Beautiful Soup
  • Pi Pico Mouse Jiggler
  • JellyFin Docker Container

Recent Comments

    Archives

    • September 2021
    • August 2021
    • July 2021
    • January 2021
    • September 2020
    • August 2020
    • June 2020
    • May 2020
    • December 2019
    • November 2019
    • November 2017
    • July 2017
    • January 2017
    • January 2016
    • December 2015
    • September 2015
    • April 2015
    • March 2015
    • November 2014

    Categories

    • Definitions
    • How To
    • Resources
    • Uncategorized

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    Google+

    Copyright © 2025 · eleven40 Pro Theme on Genesis Framework · WordPress · Log in