A problem ---"cannot convert from void to boolean"

edited April 2016 in Arduino
                    `import org.firmata.*;
                    import cc.arduino.*;
                    import processing.serial.*;
                    Arduino arduino;

                    int s1 = 7;//(r) //sensor1
                    int s2 = 8;//(y) //sensor2
                    int s3 = 9;//(b) //sensor3
                    int s4 = 10;//(g)//sensor4
                    int s5 = 11;//(b)//sensor5


                    void setup() {
                     size(500, 500);
                     background(255);
                     println(Arduino.list());

                     arduino = new Arduino(this, Arduino.list()[4], 57600); 
                     arduino.pinMode(s1, Arduino.INPUT);
                     arduino.pinMode(s2, Arduino.INPUT);
                     arduino.pinMode(s3, Arduino.INPUT);
                     arduino.pinMode(s4, Arduino.INPUT);
                     arduino.pinMode(s5, Arduino.INPUT);
                    }
                    void draw() {
                     if (arduino.digitalWrite(s1, Arduino.LOW)) {
                       ellipse(50, 50, 50, 50);
                     }
                    }
                    `

When the sensor gets information, a circle will appear. But now it cannot work! WHY?

Answers

Sign In or Register to comment.