1 2 3 4 5 6 7 8 9 10 11 12
mod datagps; use std::{thread, time::Duration}; use crate::datagps::*; fn main(){ let mut reading = DataGPS::new(Bauds::Baud9600); loop { reading.read_all_data(); println!("{}", reading.get_altitude()); thread::sleep(Duration::from_secs(1)); } }