Programming
//Arduino Data
//AC 2016
int MYO_BICEPS_PIN= A2;
int MYO_TRICEPS_PIN = A1;
void setup()
{
//Create Serial Object (9600 Baud)
Serial.begin(9600);
}
void loop()
{
int myoValueBiceps = map(analogRead(MYO_BICEPS_PIN), 0, 1023, 0, 255);
Serial.println(myoValueBiceps);
int val1 = map(analogRead(potPin2), 0, 1023, 0, 255);
Serial.println(val1);
delay(50);
}
//Processing Data.
//AC 2016
import processing.serial.*;
Serial port;
float MyOSignal = 0;
void setup()
{
size(400,400);
String portName = Serial.list()[5];
port = new Serial(this, portName, 9600);
port.bufferUntil('\n');
}
void draw()
{
background(250,250,250);
fill( MyOSignal, 200 - MyOSignal, 150- MyOSignal);
triangle(0, 400, 400, 400, 200 ,350 -MyOSignal);
fill(0, 102, 153);
textSize(32);
text("400", 10, 30);
text("300", 10, 100);
text("200", 10, 200);
text("100", 10, 300);
}
void serialEvent (Serial port)
{
MyOSignal = float(port.readStringUntil('\n'));
//brightness1 = float(port.readStringUntil('\n1'));
}
a lot of tools to descover !