Rembrandt Part 3: Making the Rembrandt Image

Building off of Pcomp projects of getting the Rembrandt image on to the big board, I will stop at no less than creating a fully articulated piece on to the big board.

Last week’s Pcomp project allowed me to reproduce, literally, the re-sized Rembrandt image on to the big board. Looking at the blurry image made me come to some key realizations:

  1. Mapping image data to the LED matrix from P5JS over serial creates very different images than manual construction (manually programming loops and shapes). I am happy about this.
  2. RBG values that produce colours on the screen are different than RBG combinations that produce similar effects on the big board.

FIXING PAST ERRORS

In last week’s program, despite it working there were still fundamental errors.

First was while the image would appear on the board, I could never bring the first two LED strips until control. They would always escape control.

Second was that if I sent the data twice, the image would turn up disjointed. The first time was fine, but the second time was not.

When I saw Danny in his office hours this week, I brought these errors to him and he gave me some good pointers:

-instead of using get() in P5 to get the pixel array, use loadPixels which returns a pixel[] array of RGBA values. (lol… wow very simple)

-set baud rate higher if transmission seems slow. He assured me the Due is fast enough to do video.

-don’t use a string, but bytes. Previously I was using parseInt() on the Arduino side, which was parsing the comma values. The room for error is higher since the arrays need to be so precise — this may be causing the error.

First problem: how to extract an array from serial.

With this code:

if (Serial.available() > 0) { // if there’s serial data available

for (int i=0; i<8960; i++) {
all[i] = Serial.read();
}

I get this error from P5.Serialport program.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *