Bare Conductive TouchBoard Arduino Input for Processing

edited March 2017 in Arduino

hi, I've tried my best to find out how to get the electrodes on my TouchBoard to work as inputs for Processing. There's a lot about other Arduino hardware bits but nothing about the TouchBoard.
It has 12 electrodes so I'd need 12 different inputs. I could change it to a MIDI input and work it that way, but I want to keep the capacitive sensing tech, so that would be a final option.
I've looked at Arduino examples on Processing but none are particularly helpful. Eventually I'd like to implement graphics and sound but I can't even work out how to create an input for the electrodes. Here is an Arduino input example to go from:

import processing.serial.*;

import cc.arduino.*;

Arduino arduino;

color off = color(4, 79, 111);
color on = color(84, 145, 158);

void setup() {
size(470, 280);

// Prints out the available serial ports.
println(Arduino.list());


// Modify this line, by changing the "0" to the index of the serial
// port corresponding to your Arduino board (as it appears in the list
// printed by the line above).
//arduino = new Arduino(this, Arduino.list()[0], 57600);


// Alternatively, use the name of the serial port corresponding to your
// Arduino (in double-quotes), as in the following line.
arduino = new Arduino(this, "/dev/tty.usbmodem1421", 57600);


// Set the Arduino digital pins as inputs.
for (int i = 0; i <= 13; i++)
arduino.pinMode(i, Arduino.INPUT);
}

void draw() {
background(off);
stroke(on);


// Draw a filled box for each digital pin that's HIGH (5 volts).
for (int i = 0; i <= 13; i++) {
if (arduino.digitalRead(i) == Arduino.HIGH)
fill(on);
else
fill(off);


rect(420 - i * 30, 30, 20, 20);
}

// Draw a circle whose size corresponds to the value of an analog input.
noFill();
for (int i = 0; i <= 5; i++) {
ellipse(280 + i * 30, 240, arduino.analogRead(i) / 16, arduino.analogRead(i) / 16);
}
}

This code doesn't do anything too exciting, but I can give other examples of other code I'm working on and trying to implement if it's needed.

Answers

Sign In or Register to comment.