- Digispark
- Rotary Encoder ; e.g WayinTop KY-040
Digispark | Rotary Encoder |
---|---|
P0 | CLK OR DT |
P1 | SW |
P2 | DT OR CLK |
My rotary encoder has an active low switch which is pulled up by an 10k ohm resistor. Together with the build in led (connected also to pin 1) the Digispark detect always a low, doesn't matter the switch is pressed or not.
Here are two solutions:
- Replace the 10k ohm pull up switch resistor with a 1.5k ohm resistor on rotary encoder
- Desolder build in led on the digispark
- VS-Code + Platformio Extension
git clone https://github.com/fixItFab/KeyBoardLight.git
TrinketHidCombo is not available on the platformio libraries. So we have to download the TrinketHidCombo library manually.
TLDR:
curl -s -L -o trinket-usb.zip https://github.com/adafruit/Adafruit-Trinket-USB/archive/master.zip && unzip trinket-usb.zip && cp -R ./Adafruit-Trinket-USB-master/TrinketHidCombo ./lib/ && rm -rf ./trinket-usb.zip ./Adafruit-Trinket-USB-master ./lib/TrinketHidCombo/usbdrv/usbdrvasm.asm
- Download TrinketHidCombo Library from Github
- Unzip it
- Copy only the
TrinketHidCombo
folder to yourlib
folder - The file
TrinketHidCombo/TrinketHidCombousbdrv/usbdrvasm.asm
maybe make trouble processing compiling & flashing. In short, delete the file, we don't need it! :) - clean up downloaded & unziped files
Now, you can start flashing.
First start the flash process and when the console print Uploading .pio/build/digispark-tiny/firmware.hex
, plug the Digispark into the USB port
After flashing, the Digisparks reboot and after a few seconds, the DialTail is ready to use.