Browse Source

for further testing purposes, draw_byte is still not stable

embedded-hal-1.0
Chris 8 years ago
parent
commit
869866d997
  1. 2
      examples/embedded_linux/src/main.rs
  2. 4
      src/drawing/mod.rs

2
examples/embedded_linux/src/main.rs

@ -150,6 +150,8 @@ fn main() {
epd4in2.delay_ms(3000);
//pub fn draw_string(&self, buffer: &mut[u8], x0: u16, y0: u16, input: String, color: &Color) {
graphics.draw_string(&mut buffer, 16, 16, &['h', 'e', 'l', 'l', 'o'], &Color::Black);
graphics.draw_char(&mut buffer, 250, 250, '#', &Color::Black);
graphics.draw_char(&mut buffer, 300, 16, '7', &Color::Black);
epd4in2.display_and_transfer_frame(&buffer, None).expect("display and transfer error");
epd4in2.delay_ms(3000);

4
src/drawing/mod.rs

@ -132,10 +132,10 @@ impl Graphics {
match color {
Color::Black => {
buffer[idx] = !filling;
buffer[idx] = filling;
},
Color::White => {
buffer[idx] = filling;
buffer[idx] = !filling;
}
}
}

Loading…
Cancel
Save