I just purchased 4 of the Qwiic Buttons (BOB-15931) boards. My project is using a ESP32 Feather from Adafruit.
This processor has FreeRTOS built in. This is my first project with ESP32 and FreeRTOS. After wiring one board up
I wrote a conventional sketch with a Setup() and loop(). In the loop I put the following code:
if (button0.isPressed() == true)
{
Serial.println (“Button0_Press”);
button0.LEDon(brightness0);
while (button0.isPressed() == true)
delay (10); //wait for user to get off the button
Serial.println (“Button0_Released”);
button0.LEDoff();
}
It compiled fine and worked great!
Next I took an example from the IDE 2.0.0 rc3 from the FreeRTOS section that contained 2 tasks
1st - to blink the builtin LED
2nd - to read an analog pin and write the value to the serial monitor
It compiled fine and worked as expected.
I then replaced the code in the analog pin read task with the code (above) to read the button.
The processor goes nuts (reboot loop)
I then replaced the code with just:
if (button0.isPressed() == true)
{
}
This empty If ststement still makes the procesor go into a reboot loop.
It appears that the SparkFun_Qwiic_Button.h library is not compatible with FreeRTOS.
Is their a fix or a compatible library for this device?
Thanks
Tom