int LED1 = 4;
int LED2 = 5;
int LED3 = 6;
void task(void *a)
{
int *pin = (int *)a;
int i = *pin;
pinMode(i,OUTPUT);
while(1)
{
digitalWrite(i,!digitalRead(i));
if(i==4)vTaskDelay(1000);
if(i==5)vTaskDelay(2000);
if(i==6)vTaskDelay(3000);
}
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32-S3!");
xTaskCreate(task,"red",1024,&LED1,1,NULL);
xTaskCreate(task,"red",1024,&LED2,1,NULL);
xTaskCreate(task,"red",1024,&LED3,1,NULL);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}