lcd *should* work?
This commit is contained in:
parent
4e1956f30d
commit
23369dcf9b
4 changed files with 20 additions and 6 deletions
23
src/main.rs
23
src/main.rs
|
@ -1,10 +1,6 @@
|
|||
//! Blinks the LED on a Pico board
|
||||
//!
|
||||
//! This will blink an LED attached to GP25, which is the pin the Pico uses for the on-board LED.
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use core::fmt::Write;
|
||||
use bsp::{
|
||||
entry,
|
||||
hal::{
|
||||
|
@ -12,10 +8,10 @@ use bsp::{
|
|||
uart::{UartConfig, UartPeripheral},
|
||||
},
|
||||
};
|
||||
use core::fmt::Write;
|
||||
use defmt_rtt as _;
|
||||
use embedded_hal::digital::v2::OutputPin;
|
||||
use embedded_hal::spi::MODE_0;
|
||||
use max31855::{Max31855, Unit};
|
||||
use panic_probe as _;
|
||||
|
||||
// Provide an alias for our BSP so we can switch targets quickly.
|
||||
|
@ -31,6 +27,9 @@ use bsp::hal::{
|
|||
watchdog::Watchdog,
|
||||
};
|
||||
|
||||
use hd44780_driver as hd44780;
|
||||
use max31855::{Max31855, Unit};
|
||||
|
||||
#[entry]
|
||||
fn main() -> ! {
|
||||
let mut pac = pac::Peripherals::take().unwrap();
|
||||
|
@ -99,6 +98,20 @@ fn main() -> ! {
|
|||
MODE_0,
|
||||
);
|
||||
|
||||
let mut lcd = hd44780::HD44780::new_4bit(
|
||||
pins.gpio16.into_push_pull_output(), //rs
|
||||
pins.gpio17.into_push_pull_output(), // enable
|
||||
pins.gpio18.into_push_pull_output(), //d4
|
||||
pins.gpio19.into_push_pull_output(), //d5
|
||||
pins.gpio20.into_push_pull_output(), //d6
|
||||
pins.gpio21.into_push_pull_output(), //d6
|
||||
&mut delay,
|
||||
).unwrap();
|
||||
|
||||
lcd.reset(&mut delay).unwrap();
|
||||
lcd.clear(&mut delay).unwrap();
|
||||
lcd.write_str("lcd initalized", &mut delay).unwrap();
|
||||
|
||||
loop {
|
||||
led_pin.set_high().unwrap();
|
||||
external_led_pin.set_low().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue