Three LEDs with Dirty Delay (ESP32)

but in the reality these 2 loops indeed run completely isolated? i mean no matter what is happening in loop1, loop2 can do blynk and wifi stuff?

that whould be a great help for time sensitive functions and stepper motor control for example!

Yes. They run on physically different CPU cores of the ESP32 because it has two Cores.

very cool! thanks for shareing :wink:

That is awesome!

One thing missing though, I haven’t got any Blynk debug output on the Serial port. So that would require some attention. Not sure why not. Other Serial output is fine.

That’s only because your rebel trio of LEDs is no match for the Blinky firepower of my fully operational battlestation of 72 LEDs :stuck_out_tongue:

However, it may have more practical applications… :blush:

That worked OK on Arduino IDE… perhaps a PlatformIO issue?

1 Like

On that “spare” void loop, which will also run stuff… which core does it use?

That is user-specified, it seems! Last argument as per comment

  // Here we create what is normally a timer thing
  // Note the last argument, this is the Core of the ESP it will run on!
  xTaskCreatePinnedToCore(loop1, "loop1", 4096, NULL, 1, NULL, 0);
  xTaskCreatePinnedToCore(loop2, "loop2", 4096, NULL, 1, NULL, 1);
1 Like

I use CoolTerm for serial monitoring. Guess it could be me. I’m just glad I can separate all the task for now. This opens up a whole new range of possibilities (mostly dirty programming, lol).

@Fettkeewl I guess then that since it is the “default” loop and otherwise unspecified, it probably runs on the default core… 0? EDIT - Nope, Core 1, based on one of those documents @Lichtsignaal posted below.

I knew the ESP had dual cores, but I thought the 2nd one was dedicated to the WiFi interface… this calls for more investigation… Meanwhile I must rethink which ESP to put in my rover as this might greatly improve its functionality without a massive timer investment.

http://esp32.info/docs/esp_idf/html/db/da4/task_8h.html#adf67e7cd0bfd1eda9e8afd048206f7c2

More info here on the specific functions you can use with xTaskCreate stuff.

And even mroe here: ESP32: Running code on a specific core - techtutorialsx (this is a good one I think).

@Gunner I think it also depends on the Priority settings, from what I can gather when creating the task

3 Likes

A side question, did you try the ADC On esp32?

I just read that it has 2 ADCs supporting 9 channels each, I was wondering if that meant that
each ADC could handle 9 different adc readings in sequence?
Or is it limited to 1 channel per adc but you can choose which one?

No idea, haven’t ADC yet, but I’ll try and see if I can add some analog stuff to it. If I can find some sensors… lol.

-edit

If I look at the pictures it just has 9 analog ports, or so it sems.

Crap, it even has 10(!!!) integrated touch sensors. This means you can use a simple copperclad board to create a keypad for example :smiley:

Pretty cool eh… This will be a sweet Blynk board once all the teething issues are worked out… OTA, BLE, WiFi, Touch, Multiple UARTS, Dual Core, Fast, lots of IO, etc.

Unfortunately the latest Update IDF libs broke something in ArduinoOTA… so that doesn’t work, and I have no idea how to revert to the “prior” update :blush: So much new too fast.

EDIT - It has been fixed now :smiley: Now I just have to figure out how to get it to work more than once… something is different in the required commands then with the ESP8266.

Looks fun :smile:
https://youtu.be/iusvNh6VfmE

ADC works here is demo:

1 Like

@Lichtsignaal Have you found the “hidden” BASIC interpreter? Nostalgia mode activated :stuck_out_tongue:

1 Like

OMG OMG OMG That is so cool :smiley:

A post was split to a new topic: I want to use Virtual Write function instead of WidgetLED