JL_IA7

Crates.ioJL_IA7
lib.rsJL_IA7
version0.1.0
sourcesrc
created_at2020-09-30 23:25:46.449398
updated_at2020-09-30 23:25:46.449398
descriptionGetting datas from GPS
homepage
repository
max_upload_size
id294841
size10,266,242
(JulienLantrin)

documentation

README

readme

How to use crate_IA7_GPS

  • connect your GPS to the raspberry berry via Tx and Rx pin.

  • create a structure like that :

    let mut data= GpsData { Uart_ : Uart::new(9600, Parity::None, 8, 1)?, id : "0".to_string(), time : "0".to_string(), lat : "0".to_string(), long : "0".to_string(), nbSat : "0".to_string(), hdop : "0".to_string(), alti : "0".to_string(), };

  • Initialisation with data.init()

  • Getting data with data.getdata()

  • All the useful data will be set in the structure () id time latitude longitude Number of sat altitude

example :

fn main() -> Result<(), Box> {

let mut data= GpsData {
    Uart_ : Uart::new(9600, Parity::None, 8, 1)?,
    id    : "0".to_string(),
    time  : "0".to_string(),
    lat   : "0".to_string(),
    long  : "0".to_string(),
    nbSat : "0".to_string(),
    hdop  : "0".to_string(),
    alti  : "0".to_string(),
};

data.init();
// println!("Start");
loop {
    data.getData();
    println!("lat : {} N", data.lat);
    println!("long : {} W", data.long);
    thread::sleep(Duration::from_millis(1000));
}

Ok(())

}

Commit count: 0

cargo fmt