progress!
I spent most of today working on pulling the sensor values into an array so I can make something draw when moving each finger. I finally got it! I used the input code from the Virtual Color Mixer code on the Arduino site, but I also had to keep the syntax from the original Flex Sensor code as well. I kept trying to just modify the code, but it wouldn’t work, so I had to strip everything down to a basic prototype to get it working. And I learned something really small, but powerful. Check this:
Serial.print (analogRead(index));
Serial.print (“,”);
Serial.println (analogRead(pinkie));
Note that the last line has “println” not just “print”. That syntax will make the next line start on a new line, breaking the stream of numbers. This is important, as this string of characters will be pulled into this code to be split and divided into the values for the index finger and the pinkie finger movements.
void serialEvent (Serial myPort) {
// get the ASCII string:
String inString = myPort.readStringUntil(‘n’);
println(inString);
if (inString != null) {
// trim off any whitespace:
inString = trim(inString);// convert to an int and split into array:
float[] curls = float(split(inString, “,”));if (curls.length >= 2) {
indexValue = map(curls[0], 0, 900, 0, 255);
pinkieValue = map(curls[1], 0, 90, 0, 255);
}
If the incoming string does not have the right syntax, it just won’t work. Now that I have a rough working prototype, now I have to paste in the dots & lines and the Twitter API to get the visuals as I want them. Good thing I have some chocolate.

