When the VideoDisplay sketch in the Teensy receives a frame of data, it puts it into the “drawingMemory” then shows the LEDs. How is that supposed to work? When does the data just sent get pushed onto the LEDs?
I am running one Teensy / octo and one data wire, btw so the frame sync stuff isn’t getting used.
if (startChar == '*') {
// receive a "master" frame - we send the frame sync to other boards
// the sender is controlling the video pace. The 16 bit number is
// how far into this frame to send the sync to other boards.
unsigned int startAt = micros();
unsigned int usecUntilFrameSync = 0;
int count = Serial.readBytes((char *)&usecUntilFrameSync, 2);
if (count != 2) return;
count = Serial.readBytes((char *)drawingMemory, sizeof(drawingMemory));
if (count == sizeof(drawingMemory)) { //<<<< So we have the image date from Processing sketch
// image data is in the "drawingMemory" buffer
unsigned int endAt = micros();
unsigned int usToWaitBeforeSyncOutput = 100;
if (endAt - startAt < usecUntilFrameSync) {
usToWaitBeforeSyncOutput = usecUntilFrameSync - (endAt - startAt);
}
digitalWrite(12, HIGH);
pinMode(12, OUTPUT);
delayMicroseconds(usToWaitBeforeSyncOutput);
digitalWrite(12, LOW);
// WS2811 update begins immediately after falling edge of frame sync
digitalWrite(13, HIGH);
leds.show(); // <<<<< "Showing" the LEDs here doesn't seem to do anything!!
digitalWrite(13, LOW);
}
I am running Processing 3 on a mac under OS X 10.11.4