renamed example to examples
This commit is contained in:
@@ -39,20 +39,20 @@ async fn main(spawner: Spawner) {
|
||||
let sda = p.PIN_4;
|
||||
let scl = p.PIN_5;
|
||||
|
||||
let i2c = I2c::new_async(p.I2C0, scl, sda, Irqs, i2c::Config::default());
|
||||
let i2c = I2c::new_blocking(p.I2C0, scl, sda, i2c::Config::default());
|
||||
|
||||
let mut device = MMC56X3::new(i2c, Delay);
|
||||
if let Err(e) = device.init().await {
|
||||
if let Err(e) = device.init() {
|
||||
error!("Failed to init {:?}", e);
|
||||
reboot().await;
|
||||
};
|
||||
|
||||
if let Err(e) = device.set_data_rate(mmc56x3::DataRate::Max1000Hz).await {
|
||||
if let Err(e) = device.set_data_rate(mmc56x3::DataRate::Max1000Hz) {
|
||||
error!("Failed to set data rate {:?}", e);
|
||||
reboot().await;
|
||||
}
|
||||
|
||||
if let Err(e) = device.set_continuous_mode(true).await {
|
||||
if let Err(e) = device.set_continuous_mode(true) {
|
||||
error!("Failed to set_continuous_mode {:?}", e);
|
||||
reboot().await;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ async fn main(spawner: Spawner) {
|
||||
// .await
|
||||
// .expect("Failed to trigger trigger_messurement");
|
||||
|
||||
match device.read_messurement().await {
|
||||
match device.read_messurement() {
|
||||
Ok(d) => info!("Got: {:?}", d),
|
||||
Err(e) => error!("Error: {:?}", e),
|
||||
}
|
||||
Reference in New Issue
Block a user