Hi, we are three students working on an interactive cloth that is containing an lilypad and 5 accelerometers (only z-values) which is connected to an MacBook Pro with an USB.
So far we have numbers coming from the Arduino circuit board to the Arduino software, reading the position of Z. However, we want the numbers to appear in Processing and are having difficulties doing so. We also want to know how to use this information to animate some jumping characters.
And the code we have so far in Processing looks like this:
import processing.serial.*;
Serial myPort; // The serial port
void setup() {
// List all the available serial ports
println(Serial.list());
// Open the port you are using at the rate you want:
myPort = new Serial(this, Serial.list()[4], 4800);
}
void draw() {
while (myPort.available() > 0) {
int inByte = myPort.read();
println(inByte);
}
}
And here is a snippet of numbers gathered from the Arduino, yes it is only reading the analog values, we have one digital that is not showing:
4,,636,73,96,638
4,,646,38,73,619
4,,619,57,76,617
4,,628,31,81,617
4,,656,38,57,619
4,,646,64,63,630
The connections on the Lilypad look like this, and we are getting values from A2, A3, A4 and A5 but not 9, because it is digital and need another string of code than analog:
It would be very helpfull if you could produce a string of code (maybe for both Arduino and Processing) we can use to get the numbers from the 5 accelerometers to Processing so I can use the values to move 5 different objects up and down according to the physical movement.