change the rs/en screen pins

main
kirbylife 2023-05-04 20:57:19 -06:00
parent 8e71f26261
commit 01d7651212
2 changed files with 13 additions and 13 deletions

View File

@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"
[dependencies]
arduino-hal = { git = "https://github.com/rahix/avr-hal", features = ["arduino-uno"] }
arduino-hal = { git = "https://github.com/rahix/avr-hal", features = ["arduino-nano"] }
ds323x = { git = "https://github.com/kirbylife/ds323x-rs", branch = "fix-set-day-format" }
hmac-sha1-compact = { git = "https://github.com/kirbylife/rust-hmac-sha1" }
panic-halt = "0.2.0"

View File

@ -39,16 +39,8 @@ fn main() -> ! {
let mut led = pins.d13.into_output();
let mut serial = default_serial!(dp, pins, 9600);
let i2c_clock = arduino_hal::I2c::new(
dp.TWI,
pins.a4.into_pull_up_input(), // SDA
pins.a5.into_pull_up_input(), // SCL
50000,
);
let mut rtc = ds323x::Ds323x::new_ds3231(i2c_clock);
let mut rs = pins.d12.into_output();
let mut en = pins.d11.into_output();
let mut rs = pins.d9.into_output();
let mut en = pins.d8.into_output();
let mut d4 = pins.d5.into_output();
let mut d5 = pins.d4.into_output();
let mut d6 = pins.d3.into_output();
@ -57,12 +49,20 @@ fn main() -> ! {
let mut display = screen::StnScreen::new(&mut rs, &mut en, &mut d4, &mut d5, &mut d6, &mut d7);
display.clear();
let i2c_clock = arduino_hal::I2c::new(
dp.TWI,
pins.a4.into_pull_up_input(), // SDA
pins.a5.into_pull_up_input(), // SCL
50000,
);
let mut rtc = ds323x::Ds323x::new_ds3231(i2c_clock);
let mut eeprom = arduino_hal::Eeprom::new(dp.EEPROM);
let mut tokens = storage::Tokens::new(&mut eeprom);
let up = pins.d6.into_pull_up_input();
let up = pins.a2.into_pull_up_input();
let mut up_button = button::Button::new(&up, true);
let down = pins.d7.into_pull_up_input();
let down = pins.a1.into_pull_up_input();
let mut down_button = button::Button::new(&down, true);
up_button.update();