Go Down

Topic: Hello good day. (Read 557 times) previous topic - next topic

Im having problems in arduino to processing..im always reading a 0 or LOW output at my command arduino.digitalRead(c), i tested it on normal arduino software, and it works well, i read 0 and 1 once i press the button.
here is my code

import processing.serial.*;
import cc.arduino.*;
Arduino arduino;

int c = 4;
int p;
void setup() {
  arduino = new Arduino(this,  Arduino.list()[0], 9600);
  arduino.pinMode(c, Arduino.INPUT);
}

void draw(){
  p = arduino.digitalRead(c);
  println(p);
}

im using processing 2.1.
ATmega328 version of arduino

thanks

PaulS

What is loaded on the Arduino when that Processing code is running?

there is no loaded code on arduino, because what i understand is that i am already acessing my arduino with the processing software. maybe im wrong..should i load a code on my arduino first?

sorry for my bad english

PaulS

Quote
should i load a code on my arduino first?

Of course. There must be something there for Processing to talk to. The Processing application is expecting you to have loaded one of the Firmata sketches on to the Arduino.

oh i see, thanks..well i think this kinda spoon feeding but what should i load on my arduino?

Thanks you sir, i already understand what you were saying really thank you so much :)

Go Up