-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DHTXX driver does not work on Arduino Uno #255
Comments
It's not a good idea to use machine.UART1 in dht/thermometer.go. |
Not sure I follow. Do you mean pass the UART from the device into |
To the boards without UART, it causes a problem to build. This is issue. |
The correct fix would be to use the mask := interrupt.Disable()
// do something with interrupts disabled
interrupt.Restore(mask) That seems reasonable for the DHTXX driver as it depends on precise timings. |
When trying to build the example for the dht driver (https://github.com/tinygo-org/drivers/blob/release/examples/dht/main.go) on Windows I get the following error:
Taking a quick look at the code for the driver, it tries to access UART1 https://github.com/tinygo-org/drivers/blob/release/dht/thermometer.go#L160, which according to the
machine
package for arduino is not defined (https://tinygo.org/microcontrollers/machine/arduino/).I tried the dirty hack of using UART or UART0 as defined in the machine package for arduino, but they don't have a method
Interrupt
as used by the driver.Cheers!
The text was updated successfully, but these errors were encountered: