We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When compiling a project with PlatformIO, targeting Arduino Mega and Arduino Due, it seems that it is unable to find the DHT sensor driver.
Here's the code:
#include "simba.h" #include "pins.h" #include "config.h" #include "events.h" #include "sensor_threads.h" #ifndef DHT_SENSOR // Omitted #else static THRD_STACK(dht_sensor_stack, 256); void *dht_sensor_thread(void *arg_p){ dht_module_init(); // Mega - W;Due - E:Implicit function declaration struct pin_device_t pin_targets[] = DHT; int pincount = sizeof(pin_targets)/sizeof(struct pin_device_t); struct dht_driver_t sensors[pincount]; // E:Incomplete element type for (int i=0;i<pincount;i++){ dht_init(&sensors[i], &pin_targets[i]); // Mega - W;Due - E:Implicit function declaration } while (1) { int sensor_count=pincount; float temperature_acc=0; float humidity_acc=0; for (int i=0;i<pincount;i++){ float temp, humidity; int res = dht_read(&sensors[i], &temp, &humidity); // Mega - W;Due - E:Implicit function declaration if (res != 0){ std_printf( FSTR("Read failed from DHT sensor %d with %d: %S\n"), i, res, errno_as_string(res) // Mega - W;Due - E:Implicit function declaration ); sensor_count--; continue; } temperature_acc+=temp; humidity_acc+=humidity; } float temp = temperature_acc/sensor_count; float hmid = humidity_acc/sensor_count; if (temp > 30){ int mask = MAXTEMP_EVENT; event_write(&temp_event, &mask, sizeof(mask)); } if (temp < 10){ int mask = MINTEMP_EVENT; event_write(&temp_event, &mask, sizeof(mask)); } if (hmid > 50){ int mask = MAXHMID_EVENT; event_write(&hmid_event, &mask, sizeof(mask)); } if (hmid < 10){ int mask = MINHMID_EVENT; event_write(&hmid_event, &mask, sizeof(mask)); } } } #endif void register_threads(){ #ifndef DHT_SENSOR thrd_spawn(temp_sensor_thread, NULL, 2, temp_sensor_stack, sizeof(temp_sensor_stack)); thrd_spawn(hmid_sensor_thread, NULL, 2, hmid_sensor_stack, sizeof(hmid_sensor_stack)); #else thrd_spawn(dht_sensor_thread, NULL, 2, dht_sensor_stack, sizeof(dht_sensor_stack)); #endif }
The text was updated successfully, but these errors were encountered:
I'm sorry, but I don't have time to give any support. I hope you can figure it out somehow.
Sorry, something went wrong.
Alright, I managed to move ahead. Everyone (Arduino IDE and PlatformIO) is on the latest release... Which does not contain the DHT sensor drivers.
No branches or pull requests
When compiling a project with PlatformIO, targeting Arduino Mega and Arduino Due, it seems that it is unable to find the DHT sensor driver.
Here's the code:
The text was updated successfully, but these errors were encountered: