i try to let an led analog flash as processing told from serial. but it looks like not realtime , i don't know how.
processing just write serial a 0-254 number and a '\n' ;
Arduino code is :
UKHeliBob:
What does happen when you run the program and send a number ?
What do you see if you print sread ?
How long do you expect the LED to stay on ?
if i send a number manually to the Arduino board it just change the led brightness with a delay.
i can't open the serial windows open while the processing is sending the serial to arduino board.
i was trying to sample a B/W photo pixel from processing , and what the led flash realtime as the brightness sample of processing...it is not a quick movement in processing ,almost one second a pixel .
You could use SoftwareSerial to communicate with Processing
No, you can't.
Processing IS capable of reading the serial port, though, so it can perform all the same functions as the Serial Monitor application.
The underlying assumption in OPs post is that the Arduino and/or its code must be at fault. More than likely, it is that Processing and the Arduino are not speaking a common language. Without seeing the Processing code, any suggestions on how to fix the Arduino code are pointless.
You could use SoftwareSerial to communicate with Processing
No, you can't.
Processing IS capable of reading the serial port, though, so it can perform all the same functions as the Serial Monitor application.
Is it not true that SoftwareSerial can write to a serial port on a PC (albeit via a level shifter) and Processing can read from a serial port on a PC ?