If you are a current student, please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.csail.mit.edu) to authenticate, and then you will be redirected back to this page.
1) Multiple Cores
The ESP32 actually has two cores on it and we've only been using one so far this semester. Some of you may benefit from putting some more periodic, blocking tasks (cough...like GETs and POST requests) on a separate core so that they won't block execution of other functionalities.
Several teams did this last year to great success. Some tutorials they used in their groups' 6.08 projects were:
- https://randomnerdtutorials.com/esp32-dual-core-arduino-ide/
- https://www.hackster.io/rayburne/esp32-in-love-with-both-cores-8dd948
Some basic code from these sites looks like the following:
// MARK: Multicore stuff
TaskHandle_t NetworkTask;
void NetworkTaskCode(void * pvParameters){
while (true){
post_heading(theta_z, user_name);
delay(250);
get_rel_fish_pos(theta_z);
}
}
void setup(){
// Pin to core
xTaskCreatePinnedToCore(
NetworkTaskCode,
"NetworkTask",
10000,
NULL,
1,
&NetworkTask,
0);
delay(50);
}