Hello everyone! Plese help me! I have problem with 2 core programming esp32 wroom 32d.
Arduino ide compiles code, but PlatformIO does’t work and say ‘task1code’ was not declared in this scope and ‘task2code’ was not declared in this scope.
Code here:
#include <Arduino.h>
#include <FreeRTOS.h>
TaskHandle_t Task1, Task2;
const uint8_t led1 = 2;
const uint8_t led2 = 5;
void setup() {
Serial.begin(115200);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
xTaskCreatePinnedToCore(
task1code,
"Task1",
10000,
NULL,
1,
&Task1,
0);
xTaskCreatePinnedToCore(
task2code,
"Task2",
10000,
NULL,
1,
&Task2,
1);
}
void loop(){
}
void task1code (void * pvParameters){
for(;;){
digitalWrite(led1, HIGH);
delay(1000);
digitalWrite(led1,LOW);
delay(1000);
}
}
void task2code (void * pvParameters){
for(;;){
digitalWrite(led2, HIGH);
delay(700);
digitalWrite(led2,LOW);
delay(700);
}
}