Browse Source

Add example for setting date and time

Kevin Lee 2 years ago
parent
commit
4f3400363a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Nixie_Firmware_Rust/src/main.rs

+ 3 - 0
Nixie_Firmware_Rust/src/main.rs

@@ -137,6 +137,9 @@ fn main() -> ! {
     // Initialize DS3231 (RTC)
     ds3231::init(DS3231_ADDR, &mut i2c);
 
+    // ds3231::set_date(DS3231_ADDR, &mut i2c, ds3231::Weekday::Wednesday, 15, 9, 21, 20);
+    // ds3231::set_time(DS3231_ADDR, &mut i2c, 00, 37, 12);
+
     // Configure input interrupt pin from DS3231 on PB5
     // Interrupt is pulled high, with open drain on DS3231 
     let mut rtc_int = gpiob.pb5.into_floating_input(&mut gpiob.moder, &mut gpiob.pupdr);