<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with #capacitivetouch - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=%23capacitivetouch</link>
      <pubDate>Sun, 08 Aug 2021 18:39:04 +0000</pubDate>
         <description>Tagged with #capacitivetouch - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/tagged%23capacitivetouch/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Play a real-time video when a capacitive sensor is touched</title>
      <link>https://forum.processing.org/two/discussion/23931/play-a-real-time-video-when-a-capacitive-sensor-is-touched</link>
      <pubDate>Sat, 26 Aug 2017 07:37:46 +0000</pubDate>
      <dc:creator>iiyeo</dc:creator>
      <guid isPermaLink="false">23931@/two/discussions</guid>
      <description><![CDATA[<p>Hello everyone, I am looking forward a method that when I touch the capacitive sensor, it transmits a signal through Arduino to the processing and then triggers the real-time video through webcam (the webcam is open to capture the video). So far, I could apply the Capacitive sensor library to solve the code problem in Arduino, but I totally have no idea how to write the code in processing and build the communication between them. Is there anyone could give me a right direction or advice or relevant posts or tutorial? Thanks a lot in advance. Sorry for my English if there is any mistake.</p>
]]></description>
   </item>
   <item>
      <title>Help needed getting Processing to open video files.</title>
      <link>https://forum.processing.org/two/discussion/21748/help-needed-getting-processing-to-open-video-files</link>
      <pubDate>Sat, 01 Apr 2017 17:27:37 +0000</pubDate>
      <dc:creator>harrisonh555</dc:creator>
      <guid isPermaLink="false">21748@/two/discussions</guid>
      <description><![CDATA[<p>hello,</p>

<p>I am wanting to replace the following code. I have a capacitive touch sensor attached to processing that opens up a random image every time the sensor is held, when the sensor is let go this image disappear.</p>

<p>I want to essentially replace the image files with 26 short video clips at 25 frame rate. Im not sure how to change this code to make that happen.</p>

<p>Any help would be great!</p>

<pre><code>import processing.serial.*;

int threshold = 30; 
PImage [] picArray = new PImage [26]; 
Serial myPort;

boolean holdImage=false;
int imgIndex;

void setup() {
  size (500, 500);

  for (int i=0; i&lt;picArray.length; i++)
    picArray[i]=loadImage(i + ".png");

  myPort = new Serial(this, Serial.list()[1], 9600);
  myPort.bufferUntil('\n');
}


void draw() {

  background (255, 255, 255); 
  if (holdImage==true) { 
    image(picArray[imgIndex], 0,0);
  }
}


void serialEvent(Serial myPort) {

  String inString = myPort.readStringUntil('\n');

  if (inString != null) {

    inString = trim (inString);
    float[] touches = float (split(inString, ","));

    if (touches.length &gt;=1) {
      int touch1Value = touches[0] &gt;= threshold ? 1: 0;

      if (touch1Value == 1) {
        if (holdImage == false) {
          imgIndex=int(random(picArray.length));
          holdImage=true;
        }
      } else
        holdImage=false;  //RELEASE holder so to detect next usr press event
    }
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Using Conductive Paint to Triggers Videos</title>
      <link>https://forum.processing.org/two/discussion/15677/using-conductive-paint-to-triggers-videos</link>
      <pubDate>Thu, 24 Mar 2016 23:22:36 +0000</pubDate>
      <dc:creator>CathyODonovan</dc:creator>
      <guid isPermaLink="false">15677@/two/discussions</guid>
      <description><![CDATA[<p>I am very new to processing and currently doing a project using conductive paint and an arduino and i have the conductive paint working in Arduino using the capacitive sensor, so when its not being touched i see "0's" in the serial port but then when it is touched i get a reading of "59's" and "60's".</p>

<p>1.what i want to do is try get the capacitive sensor working in processing with the conductive paint
2.when the paint is touched i want is to trigger playing a video on a computer. I am new to arduino and processing so i am just wondering how to go about doing this ? thanks :)</p>

<p>Below is my code in arduino using the Capacitive Sensor sketch I have tried using this in processing with the 
import processing.serial.*; but i really am not sure how to do it. any help on how to do this in a basic level would be greatly appreciated:</p>

<h1>include &lt;CapacitiveSensor.h&gt;</h1>

<p>CapacitiveSensor   cs_2_4 = CapacitiveSensor(2,4);<br />
CapacitiveSensor   cs_2_5 = CapacitiveSensor(2,5);</p>

<p>void setup()</p>

<p>{   Serial.begin(9600); }</p>

<p>void loop()</p>

<p>{ 
  long total1 =  cs_2_4.capacitiveSensor(30);<br />
    long total2 =  cs_2_5.capacitiveSensor(30);<br />
    Serial.print("X");<br />
    Serial.print(",");<br />
    Serial.print(total1);<br />
    Serial.print(",");<br />
    Serial.println();<br />
    Serial.print("Y");<br />
    Serial.print(",");<br />
    Serial.print(total2);<br />
    Serial.print(",");<br />
    Serial.println();</p>

<pre><code>delay(100);
} 
</code></pre>
]]></description>
   </item>
   <item>
      <title>How to make processing write a text according to values gotten by arduino?</title>
      <link>https://forum.processing.org/two/discussion/10863/how-to-make-processing-write-a-text-according-to-values-gotten-by-arduino</link>
      <pubDate>Sun, 17 May 2015 21:57:56 +0000</pubDate>
      <dc:creator>taru</dc:creator>
      <guid isPermaLink="false">10863@/two/discussions</guid>
      <description><![CDATA[<p>Hello, I'm trying to use a capacitive sensor on arduino as an input to then have processing draw a chart with data or just write a text according to values gotten by the sensors.
So far I've been able to read the values on the processing screen, but can't make processing write a text if the value goes over 300 for example...</p>

<p>The Arduino code is:</p>

<h1>include &lt;CapacitiveSensor.h&gt;</h1>

<p>CapacitiveSensor capSensor7 = CapacitiveSensor(13, 7);
CapacitiveSensor capSensor8 = CapacitiveSensor(13, 8);
CapacitiveSensor capSensor9 = CapacitiveSensor(13, 9);</p>

<p>void setup() {
  // open a serial connection
  Serial.begin(9600);
  }</p>

<p>void loop() {
  long sensorValue7 = capSensor7.capacitiveSensor(10);
  long sensorValue8 = capSensor8.capacitiveSensor(10);
  long sensorValue9 = capSensor9.capacitiveSensor(10);</p>

<p>delay (300);
   Serial.print("\t Lata3: ");
   Serial.print(sensorValue7);</p>

<p>Serial.print("\t Lata2: ");
   Serial.print(sensorValue8);</p>

<p>Serial.print("\t Lata1: ");
   Serial.println(sensorValue9);</p>

<p>}</p>

<p>And the processing code is:
import processing.serial.*;</p>

<p>Serial myPort;  // Create object from Serial class
String val;     // Data received from the serial port</p>

<p>void setup(){
  String portName = Serial.list()[0]; //change the 0 to a 1 or 2 etc. to match your port
  myPort = new Serial(this, portName, 9600); 
}</p>

<p>void draw()
{</p>

<p>frameRate (9);
  if ( myPort.available() &gt; 0) {<br />
  val = myPort.readStringUntil('\n');         // read it and store it in val
  } 
  println(val); //print it out in the console
}</p>

<p>Help please!!</p>
]]></description>
   </item>
   <item>
      <title>How do I read multiple bluetooth serial reads using capacitive touch sensors in Processing?</title>
      <link>https://forum.processing.org/two/discussion/4800/how-do-i-read-multiple-bluetooth-serial-reads-using-capacitive-touch-sensors-in-processing</link>
      <pubDate>Tue, 29 Apr 2014 16:30:19 +0000</pubDate>
      <dc:creator>wbandel</dc:creator>
      <guid isPermaLink="false">4800@/two/discussions</guid>
      <description><![CDATA[<p>I am working on a project that uses two lilypad arduino to read capacitive touch sensors. Right now I have hooked up two bluetooth silver mates, one to each arduino, to send serial reads to my laptop. The arduino serial monitor spits out information as:</p>

<pre><code>  smoothed = smooth(total1, .95, smoothed);   

  Serial.print(elapsedTime);
  Serial.print(" ms      ");
  Serial.print(total1);
  Serial.print("     ");
  Serial.println(smoothed);
</code></pre>

<p>Now I'm trying to get Processing to read the middle section (total1) so that it turns off/on a simple sketch. Right now I'm modifying the example "SerialMultiple". I had a classmate help me a bit by trying to show me how to split the incoming information, but I'm still at a loss as to how else to modify this sketch to work. I'm new to both arduino and processing. Any advice or references would be very helpful.</p>

<p>I'm looking to have both bluetooth devices turn on an ellipses (turn it white) based on if the total1 &gt; 40. Otherwise it will stay off (be black). Right now the capacitive touch usually has a reading of around 15 when it is off (it fluctuates a bit), and reads above 40 when I press my finger onto it.</p>

<p>This is what I have for the sketch:</p>

<hr />

<pre><code>/**
 * Many Serial Ports
 * 
 * Read data from the multiple Serial Ports
 */


import processing.serial.*;

Serial[] myPorts = new Serial[2];  // Create a list of objects from Serial class
int[] dataIn = new int[2];         // a list to hold data from the serial ports
int index = 0;

void setup()  {
  size(400, 300);
  // print a list of the serial ports:
  printArray(Serial.list());
  // On my machine, the first and third ports in the list
  // were the serial ports that my microcontrollers were 
  // attached to.
  // Open whatever ports ares the ones you're using.

// get the ports' names:
  String portOne = Serial.list()[8];
 // String portTwo = Serial.list()[9];
  // open the ports:
  myPorts[0] = new Serial(this, portOne, 9600);
//  myPorts[1] = new Serial(this, portTwo, 9600);
}


void draw() {
  // clear the screen:
  background(0);
  // use the latest byte from port 0 for the first circle
  fill(dataIn[0]);
  ellipse(width/3, height/2, 40, 40);
    // use the latest byte from port 1 for the second circle
   fill(dataIn[1]);
  ellipse(2*width/3, height/2, 40, 40);
}

/** 
  * When SerialEvent is generated, it'll also give you
  * the port that generated it.  Check that against a list
  * of the ports you know you opened to find out where
  * the data came from
*/
void serialEvent(Serial thisPort) {
  String buffer1 = myPorts[0].readStringUntil('\n');


  String [] value = split(buffer1, " ");
  //String stringTrim = trim();
  println(value);
 // String buffer2 = myPorts[1].readStringUntil('\n');

 /* if (buffer1 != null) {
    index = buffer1.indexOf(" ");
    if (index &gt; 0) {

      String stringtotal1 = buffer1.substring(index+1, buffer1.length());
      String trimtotal1 = trim(stringtotal1);

      int total1 = int(trimtotal1);
      println(total1);
    }
  }*/
}

  // variable to hold the number of the port:
  /*int portNumber = -1;

  // iterate over the list of ports opened, and match the 
  // one that generated this event:
  for (int p = 0; p &lt; myPorts.length; p++) {
    if (thisPort == myPorts[p]) {
      portNumber = p;
    }
  }
  // read a byte from the port:
  int inByte = thisPort.read();
  // put it in the list that holds the latest data from each port:
  dataIn[portNumber] = inByte;
  // tell us who sent what:
  println("Got " + inByte + " from serial port " + portNumber);*/

/*
The following Wiring/Arduino code runs on both microcontrollers that
were used to send data to this sketch:

void setup()
{
  // start serial port at 9600 bps:
  Serial.begin(9600);
}

void loop() {
  // read analog input, divide by 4 to make the range 0-255:
  int analogValue = analogRead(0)/4; 
  Serial.write(analogValue);
  // pause for 10 milliseconds:
  delay(10);                 
}


*/
</code></pre>

<p>Sorry it is kind of messy right now, but I was trying to leave the original file there as well. Please let me know if any other information would be helpful.</p>

<p>-W</p>
]]></description>
   </item>
   </channel>
</rss>