Data Collection And Preprocessing

First, I used an arduino script to read the values from the twelve channels of the MPR121.

After the Arduino script, I used (what was initially going to be) a simple bash command to read from the serial port and log the results.

npx @serialport/terminal -p /dev/tty.usbmodem1101 -b 19200 | perl -MTime::HiRes -ne '$|=1; printf "%.3f %s", Time::HiRes::time, $_' | tee -a output3.txt

As you can see, by the end it got a bit more complex...
Here's a breakdown:

First, the serialport node package1 reads from the microcontroller.


We welcome node to the scene because all of this was originally on a locally hosted web interface; I used the serialport package because I was already familiar with it. When I decided to simply record the data from terminal output, it stuck around. Was it necessary? Probably not.