LED control from Processing using Arduino library.

Hello,

i am using Processing to detect the beats in the sound and trying to write to the RGB led, something as done here..

From the code posted, i could compile the sketch and run it, but i can't get the led to fire up..
Processing is sending the correct values, but for some reason, when Arduino library is used the LED doesnt ight ..

But i can see the RX led light on Arduino high everytime, so the data transfer is going on.

To narrow things, i wrote a simple program to see if a led can fire up..

import processing.serial.*;
import ddf.minim.*;
import cc.arduino.*;

Arduino arduino;
Minim minim;

int GreenPin =  9;    // Green Pin

void setup() {
  minim = new Minim(this);

// -- I have used the correct com port from the list.
  arduino = new Arduino(this, Arduino.list()[1], 57600);

  //Setup arduino outputs
  arduino.pinMode(GreenPin, Arduino.OUTPUT);
}


void draw() {

  //Test led flash
  arduino.analogWrite(GreenPin, 255);
}

The equivalent code when uploaded to Audriono works fine.

The equivalent code when uploaded from Audriono works fine.

I have no idea what "equivalent code" you are referring to, or how you upload code FROM the Arduino.

What code are you loading on the Arduino?

in the Processing code,

arduino.analogWrite(GreenPin, 255);

should actually fire up the LED connected to Arduino ?

i dont have any code running on Arduino.. i believe Processing can directly communicate to Arduino over serial.

The RX led should not be on high everytime, but only be high when the processing sends signals or the arduino does like pressing a button on the controller. I had the same problem and when the script actually worked, i realised this rx light doesnt remain on all the time

I'm not that great at this yet but I've been learning for the past few days too.

If you're using arduino processing, from what i assume, "import cc.arduino.*;" you need to upload the example into arduino board like arduino firmata from files>>>examples>>firmata>>> standard firmata , depending on the one you're using.

Detailed explanation Arduino Playground - Processing

void draw() {

  //Test led flash
  arduino.analogWrite(GreenPin, 255);
}

When i write to Aruino directly from Processing, the RX light is on. this is because Processing uses serial communication to control Arduino.

Post some code if you have used Arduino library in Processing, btw, i am using a Uno

i dont have any code running on Arduino.. i believe Processing can directly communicate to Arduino over serial.

Every Arduino always has code running on it. Your belief has no basis in reality.

PaulS:
Every Arduino always has code running on it. Your belief has no basis in reality.

So Processing can't directly communicate to Arduino ?

i believe i missed uploading the standard sketch to Arduino

Run Arduino, open the Examples > Firmata > StandardFirmata sketch, and upload it to the Arduino board.

ref: Arduino Playground - Processing

So Processing can't directly communicate to Arduino ?

Yes, it can. But, the serial port is like a telephone line. There needs to be someone on each end of the line that understands what is being said, in order to have a telephone conversation.

There needs to be software on both ends of the serial port in order for communication to take place.

i believe i missed uploading the standard sketch to Arduino

Yes, you did. THAT software IS able to handle the Arduino end of the serial communication link.