mirror of
https://github.com/Feliix42/ssd1675.git
synced 2024-11-21 18:36:30 +00:00
Use default source and gate voltages (fixes red)
This commit is contained in:
parent
bc01c19c86
commit
cf4bf8ce76
2 changed files with 22 additions and 14 deletions
|
@ -14,7 +14,7 @@ extern crate embedded_graphics;
|
|||
use embedded_graphics::coord::Coord;
|
||||
use embedded_graphics::fonts::{Font12x16, Font6x8};
|
||||
use embedded_graphics::prelude::*;
|
||||
use embedded_graphics::primitives::{Circle, Line};
|
||||
use embedded_graphics::primitives::{Circle, Line, Rect};
|
||||
use embedded_graphics::Drawing;
|
||||
|
||||
// HAL (Traits)
|
||||
|
@ -84,14 +84,11 @@ fn main() -> Result<(), std::io::Error> {
|
|||
Font12x16::render_str("Hello Rust")
|
||||
.with_stroke(Some(Color::Red))
|
||||
.with_fill(Some(Color::White))
|
||||
.translate(Coord::new(5, 10))
|
||||
.translate(Coord::new(5, 88))
|
||||
.into_iter(),
|
||||
);
|
||||
println!("draw");
|
||||
|
||||
display.update(&mut delay).expect("error updating display");
|
||||
println!("update...");
|
||||
|
||||
// display.set_rotation(DisplayRotation::Rotate90);
|
||||
// display.draw(
|
||||
// Font::render_str("Rotate 90!")
|
||||
|
@ -128,22 +125,30 @@ fn main() -> Result<(), std::io::Error> {
|
|||
// println!("Now test new graphics with default rotation and some special stuff:");
|
||||
// display.clear_buffer(Color::White);
|
||||
|
||||
// // draw a analog clock
|
||||
// draw a analog clock
|
||||
display.draw(
|
||||
Circle::new(Coord::new(32, 32), 30)
|
||||
.with_stroke(Some(Color::Black))
|
||||
.with_stroke_width(2)
|
||||
.into_iter(),
|
||||
);
|
||||
// display.draw(
|
||||
// Circle::new(Coord::new(64, 64), 64)
|
||||
// Line::new(Coord::new(32, 32), Coord::new(0, 32))
|
||||
// .with_stroke(Some(Color::Black))
|
||||
// .with_stroke_width(2)
|
||||
// .into_iter(),
|
||||
// );
|
||||
// display.draw(
|
||||
// Line::new(Coord::new(64, 64), Coord::new(0, 64))
|
||||
// .with_stroke(Some(Color::Black))
|
||||
// .into_iter(),
|
||||
// );
|
||||
// display.draw(
|
||||
// Line::new(Coord::new(64, 64), Coord::new(80, 80))
|
||||
// Line::new(Coord::new(32, 32), Coord::new(40, 40))
|
||||
// .with_stroke(Some(Color::Black))
|
||||
// .with_stroke_width(2)
|
||||
// .into_iter(),
|
||||
// );
|
||||
display.draw(
|
||||
Rect::new(Coord::new(32, 32), Coord::new(64, 64))
|
||||
.with_fill(Some(Color::Black))
|
||||
.into_iter(),
|
||||
);
|
||||
|
||||
// // draw white on black background
|
||||
// display.draw(
|
||||
|
@ -194,6 +199,8 @@ fn main() -> Result<(), std::io::Error> {
|
|||
|
||||
// delay.delay_ms(1_000u16);
|
||||
// }
|
||||
display.update(&mut delay).expect("error updating display");
|
||||
println!("update...");
|
||||
|
||||
println!("Finished - going to sleep");
|
||||
display.deep_sleep()
|
||||
|
|
|
@ -64,7 +64,8 @@ impl<I> Display<I> where I: DisplayInterface {
|
|||
Command::DummyLinePeriod(0x07).execute(&mut self.interface)?;
|
||||
Command::GateLineWidth(0x04).execute(&mut self.interface)?;
|
||||
|
||||
Command::SourceDrivingVoltage(0x2D, 0xB2, 0x22).execute(&mut self.interface)?;
|
||||
// Command::GateDrivingVoltage(0b10000 | 0b0001);
|
||||
// Command::SourceDrivingVoltage(0x2D, 0xB2, 0x22).execute(&mut self.interface)?;
|
||||
Command::WriteVCOM(0x3C).execute(&mut self.interface)?;
|
||||
|
||||
// POR is HiZ. Need pull from config
|
||||
|
|
Loading…
Reference in a new issue