Collection of CircuitPython scripts for my Raspberry Pi Pico projects
- Download CircuitPython for Raspberry Pi Pico from here
- Plug in the new Raspberry Pi Pico and drop the downloaded uf2 file onto the mounted drive
- Download Adafruit's extra library bundle from here
- Unzip it and copy
lib/adafruit_hid
to thelib
folder of the Pico - Copy
code.py
and all files in theshared
folder to the root of the Pico
- Recommended editor: Mu Editor (full Adafruit Tutorial)
- Open a python file directly from the Pico
- Edit the file
- Press the
Check
👍 toolbar button to verify your code compiles - Open the
Serial
↔️ pannel - Save the edited file
Encoder(
"IDEA Move Block Up/Down",
board.GP0, board.GP1, # Replace with your GPIO pin numbers
send(Keycode.CONTROL, Keycode.SHIFT, Keycode.UP_ARROW),
send(Keycode.CONTROL, Keycode.SHIFT, Keycode.DOWN_ARROW),
),
Button(
"IDEA Select More",
board.GP22, # Replace with your GPIO pin number
send(Keycode.CONTROL, Keycode.W)
),
Encoder(
"IDEA Debugging",
board.GP4, board.GP5, # Replace with your GPIO pin numbers
send(Keycode.SHIFT, Keycode.F8), # Turn left: Step out of
send(Keycode.F8), # Turn right: Step over
),
Button(
"IDEA Debugging Step Into",
board.GP6, # Replace with your GPIO pin number
send(Keycode.F7), # Press button: Step into
)
Encoder(
"IDEA Search & Find Next",
board.GP2, board.GP3, # Replace with your GPIO pin numbers
send(Keycode.SHIFT, Keycode.F3),
send(Keycode.F3),
),
Button(
"Search",
board.GP7, # Replace with your GPIO pin number
send(Keycode.CONTROL, Keycode.F),
),
Encoder(
"Linux Change Workspace",
board.GP2, board.GP3, # Replace with your GPIO pin numbers
send(Keycode.ALT, Keycode.CONTROL, Keycode.LEFT_ARROW),
send(Keycode.ALT, Keycode.CONTROL, Keycode.RIGHT_ARROW),
),
Button(
"Linux Tile Windows",
board.GP6, # Replace with your GPIO pin number
send(Keycode.COMMAND), # Press button: Tile Windows
)
Button(
"IDEA Run Test",
board.GP8, # Replace with your GPIO pin number
send(Keycode.CONTROL, Keycode.F5),
),
Button(
"IDEA Comment",
board.GP9, # Replace with your GPIO pin number
send(Keycode.CONTROL, Keycode.FORWARD_SLASH),
),
Button(
"IDEA Organize Imports",
board.GP17, # Replace with your GPIO pin number
send(Keycode.CONTROL, Keycode.ALT, Keycode.O),
),
Button(
"IDEA Reformat Code",
board.GP18, # Replace with your GPIO pin number
send(Keycode.CONTROL, Keycode.ALT, Keycode.L),
),
Button(
"Linux Lock Screen",
board.GP10, # Replace with your GPIO pin number
send(Keycode.COMMAND, Keycode.L),
),
Button(
"Slack Thumbs Up",
board.GP19, # Replace with your GPIO pin number
write(":+1: "), # KeyDown
send(Keycode.CONTROL, Keycode.ENTER), # KeyUp
)
Button(
"OS Copy/Cut",
board.GP16,
noOp, # KeyDown -> nothing
send(Keycode.CONTROL, Keycode.C), # KeyUp (Short) -> copy
send(Keycode.CONTROL, Keycode.X), # KeyUp (Long) -> cut
),
Button(
"Emacs Save & Close",
board.GP19, # Replace with your GPIO pin number
sequence(, # KeyDown -> Save
send(Keycode.CONTROL, Keycode.X),
send(Keycode.CONTROL, Keycode.S),
),
sequence(, # KeyUp -> Exit
send(Keycode.CONTROL, Keycode.X),
send(Keycode.CONTROL, Keycode.C),
),
)