Last active
August 10, 2018 04:20
-
-
Save lupyuen/0322594fb494bd9aa5c91770d71eb021 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void sensor_setup(uint8_t display_task_id) { | |
// Start the sensor tasks for each sensor to read and process sensor data. | |
// Edit this function to add your own sensors. | |
// Set up the sensors and get their sensor contexts. | |
const int pollInterval = 500; // Poll the sensor every 500 milliseconds. | |
SensorContext *tempContext = setup_temp_sensor(pollInterval, display_task_id); | |
SensorContext *humidContext = setup_humid_sensor(pollInterval, display_task_id); | |
// For each sensor, create sensor tasks using the same task function, but with unique sensor context. | |
// "0, 0, 0" means that the tasks may not receive any message queue data. | |
//// debug(F("task_create")); //// | |
task_create(sensor_task, tempContext, 10, // Priority 10 = highest priority | |
0, 0, 0); // Will not receive message queue data. | |
task_create(sensor_task, humidContext, 20, // Priority 20 | |
0, 0, 0); // Will not receive message queue data. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment