From e51a769cddcdf9cf2cc7dc27fb111e6ef2fd8e06 Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 3 Sep 2022 08:34:07 -0500 Subject: [PATCH] Fix library includes and GPIO names (#93) --- README.md | 8 +++++--- duckyinpython.py | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 818d9e0..a2a1952 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,13 @@ Install and have your USB Rubber Ducky working in less than 5 minutes. 5. Navigate to `lib` in the recently extracted folder and copy `adafruit_hid` to the `lib` folder in your Raspberry Pi Pico. -6. Click [here](https://raw.githubusercontent.com/dbisu/pico-ducky/main/duckyinpython.py), press CTRL + S and save the file as `code.py` in the root of the Raspberry Pi Pico, overwriting the previous file. +6. Copy `adafruit_debouncer.mpy` and `adafruit_ticks.mpy` to the `lib` folder in your Raspberry Pi Pico. -7. Find a script [here](https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Payloads) or [create your own one using Ducky Script](https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Duckyscript) and save it as `payload.dd` in the Pico. +7. Click [here](https://raw.githubusercontent.com/dbisu/pico-ducky/main/duckyinpython.py), press CTRL + S and save the file as `code.py` in the root of the Raspberry Pi Pico, overwriting the previous file. -8. Be careful, if your device isn't in [setup mode](#setup-mode), the device will reboot and after half a second, the script will run. +8. Find a script [here](https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Payloads) or [create your own one using Ducky Script](https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Duckyscript) and save it as `payload.dd` in the Pico. + +9. Be careful, if your device isn't in [setup mode](#setup-mode), the device will reboot and after half a second, the script will run. ### Setup mode diff --git a/duckyinpython.py b/duckyinpython.py index 2be83dd..e4d0e05 100644 --- a/duckyinpython.py +++ b/duckyinpython.py @@ -18,6 +18,8 @@ import supervisor import time import digitalio +from digitalio import DigitalInOut, Pull +from adafruit_debouncer import Debouncer from board import * import pwmio @@ -129,7 +131,7 @@ time.sleep(.5) led_pwm_up(led) #init button -button1_pin = DigitalInOut(board.IO22) # defaults to input +button1_pin = DigitalInOut(GP22) # defaults to input button1_pin.pull = Pull.UP # turn on internal pull-up resistor button1 = Debouncer(button1_pin)