Hi, this is my first post and also my first processing experience.
I'm an enginnering student and have much experience using arduino, now im trying to get images from a serial camera trough the arduino.
To test Ive made this simple sketch, the arduino program waits for an 'a' in the serial and then responds with 1000 bytes of random data. The background change is to see if there is data coming and works ok, but no pixel change.
is the code ok?
Sorry for my bad english.
import processing.serial.*;
Serial myPort;
char valr;
char valg;
char valb;
int indx=0;
PImage img;
void setup() {
size(500, 500,P2D);
background(0);
String portName = Serial.list()[1];
myPort = new Serial(this, portName, 115200);
img = createImage(400, 400, RGB);
image(img, 0, 0);
}
void draw() {
byte[] inBuffer = new byte[1500];
img.loadPixels();
int ix=0;
/* while ( myPort.available() > 0) { // If data is available,