This repo contains the Arduino code for the hardware side of lighten.
The following Arduino libraries are required:
- Adafruit TSL2591 library
- Adafruit Unified Sensor
- Adafruit TinyUSB (The board used should have built-in support for this library)
This tutorial explains how to set up the first two.
The TinyUSB library can be installed similarly:
In the Arduino IDE menus, go to Sketch -> Include Library -> Manage Libraries, then search for and install Adafruit TinyUSB.
Now clone the arduino-lighten repo:
git clone https://github.com/jcrd/arduino-lighten.git
Open the arduino-lighten.ino
file in the Arduino IDE and upload it to the board.
Appropriate udev rules must be configured to access the HID device.
Create a .rules
file in /etc/udev/rules.d
that looks like:
SUBSYSTEM=="usb", ATTR{idVendor}=="239a", ATTR{idProduct}=="8111", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
KERNEL=="hidraw*", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="8111", MODE="0660", GROUP="plugdev", TAG+="uaccess", TAG+="udev-acl"
where the idVendor
and idProduct
attributes reflect the values found using lsusb
:
Bus 005 Device 002: ID 239a:8111 Adafruit QT Py ESP32-S2
The sixth column contains the IDs in the format: vendor:product
.
See this section of the hidapi Python library documentation for more information.
This project is licensed under the MIT License (see LICENSE).