Circuitpython HID emulator device with smart home functions
Handy clicker is raspberry pi pico based device with additional keyboard for fpv cameras.
Example keyboard --> LINK <--
How does it work?
OSD camerea pilot on circuitboard got different resistors combined with buttons. So if you push "UP" button there occour e.g. 6000 m ohm when down e.g 2000 m ohm.
I connected keyboard to pico pin's no 26 which is used to read analog values. After that I measured all values corresponding to each button and save results.
Remember when want read analog values must add additional resistor.
Using python API tuyapy it's possible to controll sonoff devices like power switch connected with night lamp.
Remember ! Insert code.py to raspberry pi pico
Whole tutorial : HOW READ ANALOG VALUE
api = TuyaApi()
api.init(USERNAME, PASSWORD, COUNTRY_CODE)
for device in api.get_all_devices():
id = device.object_id()
print(id)
api.get_device_by_id("***").turn_off()
api.get_device_by_id("***").turn_on()
- Enter button - play Boney M. - Rasputin
- UP/DOWN button - turn off/on sonoff switch
- RIGHT button - Type import statement from txt file (ansi)
- CircuitPython - 6.3.0
- Python - 3.8
- tuyapy - api for smart home devices
- optparse - 1.5.3 - to use flags in cmd