Arduino, Processing and 2 HC-SR04 Ultrasonic Sensor problems. Please help....

It kind of works now

So, you're saying this

if (d1>=dist){
   currentState=currentState +1;

else

compiles?