Setting Up Capacitive Touch Sensors
In the past week, we had an issue with setting up the capacitive sensors in the studio. To double-check if our issue was due to the studio's network or not, I took the sensor with me to try the same setup at home. After a few tries, I was able to make it work. Here are the detailed steps I followed:
- Make sure to download the latest version of Thonny. I originally had an older version, and until I updated the software, I wasn't able to proceed to step 2.
- Set the Thonny interpreter to MicroPython. Go to Tools > Options > Interpreter and set it to MicroPython (Raspberry Pi Pico). I left the remaining settings as is. Restart Thonny to make sure everything is set.
- Connect the capacitive sensors to the computer. The files and settings in Adafruit should appear at the bottom of the Files window in Thonny. (Open files window from View > Files.)
- Open the "settings.toml" file from the left window. Set the SSID and password to the same network that the computer is connected to. Leave the Web API password as is.
- Open the "code.py" file from the left window. On line 13, change the udp_host IP address to the IP address of the computer that will receive the data. Do not change the port number on line 16, but keep it in mind.
- Save both files and re-run Adafurit. Press the STOP button on top of the Thonny window to reboot.
- Disconnect the sensors from the computer and plug into a power source. Just a regular portable phone charger with a USB port will do.
- Launch TouchDesigner and create a "udp in" DAT. Set the port number according to the code (8888). From the dropdown, select "one per message" for Row/Callback format. Set the local address to the same computer IP address from the code.
- All done! Now hope for the best and see if the sensors work and data shows up in Touch. If it doesn't work, double-check the code for IPs and port number, make sure Adafruit is running before unplugging from the computer, and the portable battery is actually charged.
Comments
Post a Comment