So, my first experiment was a failure.
The objective was to capture a screenshot of LCD. What I did:
1. Checked how FlashingLEDs guy processed bit data to build the screenshot (here)
2. Implemented it in the Teensy
3. Collected frame data via serial
4. Tried to visualize it
And here's the result:
and it was supposed to be Tetris
I receive consistent data on the PC - each frame has 144*160 pixels, which is a good sign. Now I need to analyze the results thoroughly and double check everthing. I definitely am missing something here.
My Teensy code (rather dirty since I was too eager to see the result, didn't have time to do it by the book):
http://pastebin.com/1GUhf2nR
On the PC side I used pyserial to collect data:
import serial
port = '/dev/tty.usbmodem34521'
speed = 4000000
buflen = 100
ser = serial.Serial(port, speed)
fd = open('screen_data.bin', 'wb')
try:
while True:
data = ser.read(buflen)
fd.write(data)
except KeyboardInterrupt as e:
print 'Shutting down'
fd.close()
ser.close()
Then I parsed it and built a scatterplot using matplotlib: http://pastebin.com/AS4uesLh
Hopefully I'll find some time this week to play with it more, but currently I'm a bit loaded with my actual work. Anyways if you guys have ideas what is wrong with my code I'd appreciate if you shared. Cheers!