[−][src]Trait adafruit_led_backpack::BicolorMatrix8x8
Operate a Bicolor 8x8 Matrix LED backpack
Required methods
fn update_bicolor_led(&mut self, x: u8, y: u8, color: Color) -> Result<(), E>
Updates a single LED in the 8x8 grid, where (0,0) is at the bottom-left corner
Implementations on Foreign Types
impl<I2C, E> BicolorMatrix8x8<E> for HT16K33<I2C> where
I2C: Write<Error = E> + WriteRead<Error = E>,
[src]
I2C: Write<Error = E> + WriteRead<Error = E>,
fn update_bicolor_led(&mut self, x: u8, y: u8, color: Color) -> Result<(), E>
[src]
Update a specific LED with color, optionally switching on both red and green in-order to look yellow.
Arguments
x
- x coordinate, from 0 to 8y
- y coordinate, from 0 to 8color
- color of the LED (or off)
Examples
use ht16k33::i2c_mock::I2cMock; use ht16k33::{HT16K33, Display}; use adafruit_led_backpack::{BicolorMatrix8x8, Color}; // Create an I2C device. let mut i2c = I2cMock::new(); // Create a HT16K33 instance, the implementation of BicolorMatrix8x8 is in scope. let mut ht16k33 = HT16K33::new(i2c, 0x70); ht16k33.initialize(); ht16k33.update_bicolor_led(4, 4, Color::Red); ht16k33.set_display(Display::ON); ht16k33.write_display_buffer();