Feeling slow. I’m generating pixel values in R to send to my 16x16 matrix. I thought it would be easier to just have my teensy 3.2 take values from python via serial vs. defining huge arrays ahead of time. I see this referenced a lot:
Serial.readBytes( (char*)(&leds[i]), 3);
Far less do I see how one might actually send the data. I don’t understand what the arduino/teensy is expecting. For example:
import serial
ser = serial.Serial('/dev/ttyACM0')
ser.write(???)
To prototype, I’m just substituting 0 (zero) for i in the code (just trying to control the color of the first led via serial). From the pyserial docs, I think I’m supposed to send something like this:[1]
b’the_data’
I’m just not sure what ‘the_data’ should be. I’ve tried things like a list [b’0’, b’0’, b’0’] (didn’t work) and other incantations. The closest I got was b’0 255 0’ where I thought I got the expected color, but eventually it just became white again.
Thanks for any pointers!
[1] http://pyserial.readthedocs.io/en/latest/shortintro.html