I am using an Arduino Uno with firmata and processing to read values from a sensor which works fine but also to write values to an LED which doesn't work at all.
I am using Pachube to send and recieve data from a server.
I have the arduino & eeml (pacube) library folder in the right place.
Everything thing works on my laptop and it is the exact same code and OS ( os x 10.5.80)
Hi guys, I'm new to processing and I have a problem converting a float to an int.
What my sketch is doing is getting a data from an XML feed & printing it as a float.
I am trying to interface it with Arduino to control a motor.
Any ideas??
Thanks in advance.
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
//setting up my pins
int vibPin = 9;
float[] magVal;
int xx;
int newMag;
void setup() {
size(200, 200);
arduino = new Arduino(this, Arduino.list()[0],57600); // creates an arduino object. the Parent is "this" the name is the name of the device, the rate of the speed is the baud rate.
println(Arduino.list()); // prints a list of of available serial ports
arduino.pinMode (vibPin, Arduino.OUTPUT);
}
void draw() {
float[] magVal = getMag(); // gets the latest earthquake reading.
int xx = magVal.length;
println(magVal[xx-1]);
delay(1000*30); // will search for a new earthquake every 30seconds