shows the results of this
effort on the Picadillo 35T
display, along with the FPS
calculations.
Listing 5. Stream Image Data from the Camera
With this program —
using a totally different
library and LCD graphics
display — I still see the
uCAM-II blooming on me.
void loop(void)
{
uint16_t n;
// Lets get a picture! I hope...
Serial1.write(GETPIC,6); // Send the GET PICTURE command
It just seems to have
problems with really dark
colors like black and dark
brown. Lighter colors like
yellow, tan, and white
seem to be fine.
for (n=0;n<6;n++) {
while(!Serial1.available());
status[n] = Serial1.read();
}
if (status[1] != CACK) { // ACK, that command passed
Serial.println("We barfed on GET PICTURE.");
I will need to
experiment more with the
camera to see if I can
improve its color palette. In
terms of most robot vision
operations, this is no big
deal. The user can simply
modify the color map table
lookups to get the correct
values, or simply deal with
image changes to
determine what to do.
Serial.print("Error: ");Serial.println((int)status[4],HEX);
while(1); // freeze here
}
for (n=0;n<6;n++) {
while(!Serial1.available());
status[n] = Serial1.read();
}
if (status[1] != CDATA) { // We got the data response
Serial.println("We barfed on the DATA return.");
Serial.print("Error: ");Serial.println((int)status[4],HEX);
while(1); // freeze here
}
// We aren't going to look at the image size, we know it already.
Conclusion
This board/LCD/camera
combination shows promise
in the cost/performance
category with respect to
folks that feel more
comfortable with the
simple “wired” interface
that Arduino/chipKIT
programming offers. It is
really cool that the 4D
while (!Serial1.available()); // wait for DATA response
for (n=0;n<16384;n++) { // Get our screen image
while(!Serial1.available());
convert.byte[1] = Serial1.read();
while(!Serial1.available());
convert.byte[0] = Serial1.read();
pg1[n] = convert.word; // grab data as fast as we can!
}
delay(1);
Serial1.write(ACKF,6); // ACK that we got the image
// send data to the "window" on the Picadillo 35T
tft.openWindow(96, 128, 128, 128);
tft.windowData(pg1,16384);
tft.closeWindow();
Systems’ Picadillo 35T uses
the Digilent bootloader,
plus the MPIDE/UECIDE IDE and libraries. What an
awesome setup for users that don’t want to hunt down or
Okay, that’s it for Mr. Roboto this month. Keep those
emails coming to me at roboto@servomagazine
(gasp!) have to write their own.
You can get the sketch I have been describing at the
article link as PICd35T.zip.
18 SERVO 05.2015