All kinds of issues - amateur at processing

edited March 2017 in Arduino

Hi. I am trying to create a sketch that, upon turning a potentiometer hooked up to an arduino, causes 3 different videos to be played, based on what value the potentiometer stops at. I want the arduino to stop taking in sensor data while a video is playing. A lot of strange issues come up, I've attached a screenshot with the majority of errors. The places where it says "error on )" usually indicating a missing parentheses, all parentheses are closed and if i open them back up it still shows an error.

other than this, firmata is uploaded to arduino and testing fine.

Here is the code: Thanks for any help!

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

import processing.video.*;

import processing.serial.*;

Arduino arduino;

Movie oneDegree;
Movie twoDegrees;
Movie threeDegrees;

int sensor = A0;    // select the input pin for the potentiometer
int val = 0;

float value;

void setup() {
  size(1920, 1080);
  arduino = new Arduino(this, Arduino.list()[0], 57600); //sets up arduino
   val = analogRead(sensor); //setup pins to be input (A0 =0?)
  oneDegree = new Movie(this, "comp1.mp4");
  twoDegrees = new Movie(this, "comp2.mp4");
  threeDegrees = new Movie(this, "comp3.mp4");

}

void draw() {
 val = analogRead(sensor); 
 println(val);
 if(val <= 348) { 
    oneDegree.play();
  }

  else if(348 < val <= 686) {
  twoDegrees.play();
  }

  else if(686 < val <= 1024) {
  threeDegrees.play();
  }

  while( oneDegree.play(), twoDegrees.play(), threeDegrees.play()){
  analogRead(sensor) OFF;
  }![]()

}

Screen Shot 2017-03-27 at 12.19.20 AM

Tagged:

Answers

Sign In or Register to comment.