Arduino Uno issue with interfacing with a dht11 sensor.

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • dht-sensor

    Rust embedded-hal based driver for the DHT11/DHT22 sensor

  • Ah, that would actually explain the timeouts on AVR and ESP (the code just sets the pin to high and waits until it's pulled low by DHT, which doesn't happen).

  • avr-hal

    embedded-hal abstractions for AVR microcontrollers

  • /* * For examples (and inspiration), head to * * https://github.com/Rahix/avr-hal/tree/main/examples * * NOTE: Not all examples were ported to all boards! There is a good chance though, that code * for a different board can be adapted for yours. The Arduino Uno currently has the most * examples available. */ #![no_std] #![no_main] use dht_sensor::*; use panic_halt as _; #[arduino_hal::entry] fn main() -> ! { let dp = arduino_hal::Peripherals::take().unwrap(); let pins = arduino_hal::pins!(dp); let mut serial = arduino_hal::default_serial!(dp, pins, 57200); let mut pin3 = pins.d3.into_opendrain_high(); let mut delay = arduino_hal::Delay::new(); ufmt::uwriteln!(serial, "{}", "waiting for sensor...").unwrap(); arduino_hal::delay_ms(2000); loop { match dht11::Reading::read(&mut delay, &mut pin3) { Ok(dht11::Reading { temperature, relative_humidity, }) => ufmt::uwriteln!(serial, "{}°, {}% RH", temperature, relative_humidity).unwrap(), Err(_e) => ufmt::uwriteln!(serial, "Error {}", "Unable to read").unwrap(), } arduino_hal::delay_ms(2000); } }

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts