So that stopped the errors, but when I run the following code I get nothing.
Code:
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
int verPin = 0;
int horPin = 1;
float ver = 1;
float hor = 2;
void setup() {
size(400, 400);
stroke(255);
arduino = new Arduino(this, Arduino.list()[0], 9600);
arduino.pinMode(verPin, Arduino.INPUT);
arduino.pinMode(horPin, Arduino.INPUT);
}
void draw() {
background(192, 64, 0);
ver = arduino.analogRead(verPin);
ver = map(ver, 0, 1023, 0, height);
hor = arduino.analogRead(horPin);
hor = map(hor, 0, 1023, 0, width);
line(width/2, height/2, hor, ver);
}
I have the following code running on my Arduino, and the serial monitor on the Arduino's GUI is spitting out proper numbers.
Code:
int verPin = 0;
int horPin = 1;
int ver = 234;
int hor = 456;
void setup()
{
Serial.begin(9600);
pinMode(verPin, INPUT);
pinMode(horPin, INPUT);
}
void loop()
{
ver = analogRead(verPin);
ver = map(ver, 0, 1023, 0, 100);
hor = analogRead(horPin);
hor = map(hor, 0, 1023, 0, 100);
Serial.print("Vertical ");
Serial.println(ver);
Serial.print("Horizontal ");
Serial.println(hor);
delay(100);
}
Nothing happens to the line in the Processing window, what's wrong now that there's not an error message?