We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have conductive paint which works in an arduino using the capacitive touch library and when its touched i get a reading between 50 and 60 in the serial port. however i need to get the conductive paint sensor working in processing but i am having difficulty as the only output i get in processing is null and i am looking for help as to what i am doing wrong or if there is any simpler ways of going about this. I am very new to this but am desperate to get this working
code for arduino:
CapacitiveSensor cs_2_4 = CapacitiveSensor(2,4);
void setup()
{
Serial.begin(9600); }
void loop()
{
long start = millis();
long total5 = cs_2_4.capacitiveSensor(30);
Serial.print(millis() - start); // check on performance in milliseconds
Serial.print("\t"); // tab character for debug windown spacing
Serial.println(total5); // print sensor output 1
// print sensor output 3
delay(10); // arbitrary delay to limit data to serial port
}
code for processing:
import processing.serial.*;
Serial myPort; // Create object from Serial class
String val; // Data received from the serial port
void setup() { size(400,400); myPort = new Serial(this, Serial.list()[0], 9600); }
void draw()
{ if ( myPort.available() > 0)
{ // If data is available, val = myPort.readStringUntil('\n'); // read it and store it in val }
println(val); //print it out in the console }
Answers
Please learn how to format your code for posting here. Edit your post, select the code, and pres CTRL + o.
So your problem is that you are trying to read data over a serial port. Okay. What serial port reading example code did you start with?
so this is what i view in the serial port and you can see when the conductive paint is touched that value jumps up around 50-60's. What i want to be able to do at the end of this project is have the conductive paint to act as like a midi board which triggers different videos to play.
https://forum.Processing.org/two/discussion/15904/controlling-resolume-with-processing