Hello
Got me a Trinket M0 with CircuitPython
Successfully loaded and ran Trinket M0 Media Dial code and functionality with rotary encoder (arrow up-arrow down)
Actually, I want to change windows function from arrow up-down to volume increment-decrement
added the import for the correct library as shown in:
https://circuitpython.readthedocs.io/pro...mercontrol
More than likely, I will never touch Python or related stuff. Looks like a simple thing to fix, any help would be awesome
Got me a Trinket M0 with CircuitPython
Successfully loaded and ran Trinket M0 Media Dial code and functionality with rotary encoder (arrow up-arrow down)
Actually, I want to change windows function from arrow up-down to volume increment-decrement
added the import for the correct library as shown in:
https://circuitpython.readthedocs.io/pro...mercontrol
import time from digitalio import * from board import * from adafruit_hid.keyboard import Keyboard from adafruit_hid.keycode import Keycode from adafruit_hid.consumer_control_code import ConsumerControlCode import neopixel Modified original code: # Check if rotary encoder went up if encoder_direction == 1: kbd.press(Keycode.CONTROL, Keycode.UP_ARROW) kbd.release_all() # Check if rotary encoder went down if encoder_direction == -1: kbd.press(Keycode.CONTROL, Keycode.DOWN_ARROW) kbd.release_all() to # Check if rotary encoder went up if encoder_direction == 1: consumer_control.send(ConsumerControlCode.VOLUME_INCREMENT) # Check if rotary encoder went down if encoder_direction == -1: consumer_control.send(ConsumerControlCode.VOLUME_DECREMENT)Does not work, Trinket shows its a NameError (it has an RGB status LED on the board)
More than likely, I will never touch Python or related stuff. Looks like a simple thing to fix, any help would be awesome