8x8 Bicolor backpack Python question

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
ibrook
 
Posts: 2
Joined: Sun Oct 06, 2013 2:19 pm

8x8 Bicolor backpack Python question

Post by ibrook »

With the 8x8 bicolor backpack, is there a simple way using the python library to specify a color when lighting up an entire row (writeRowRaw)?

There is a class that lets you set the color on an individual pixel but I can't figure out an easy way to do an entire row without iterating over each pixel. Any help is appreciated.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: 8x8 Bicolor backpack Python question

Post by adafruit_support_rick »

ColorEightByEight:setPixel calls setBufferRow, and computes the bit offset of a single pixel to set that color.
To do the entire row in one shot, you would call setBufferRow with the row number and a 16-bit value specifying the colors of all 8 pixels.

color 0 (off) is 0
color 1 is 0x00FF
color 2 is 0xFF00
color 3 is 0xFFFF

ibrook
 
Posts: 2
Joined: Sun Oct 06, 2013 2:19 pm

Re: 8x8 Bicolor backpack Python question

Post by ibrook »

Thank you. That's helpful. It might be a useful bit of info to include in the GitHub readme for the library or in the online tutorials.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”