Why it does not work? Piezo sensor, firmata, processing and Arduino

edited April 2016 in Arduino

import processing.serial.*; import org.firmata.*; import cc.arduino.*;

Arduino arduino;

int S1 = 0; int A; void setup() { size(500, 500); ellipseMode(CENTER);

arduino = new Arduino(this, Arduino.list()[0], 57600);

arduino.pinMode(S1, Arduino.INPUT); }

void draw() {

A = arduino.analogRead(S1); println(A); if (A ==1) { ellipse(width/2,height/2,100,100); } }

Tagged:
This discussion has been closed.