0

LED example for MRMS ESP32: Arduino, IMU, eFuse, BT, WiFi, CAN Bus (mrm-esp32)

Prerequisites

If not already done so already, install Arduino software and make basic connections, as described in page for MRMS ESP32: Arduino, IMU, eFuse, BT, WiFi, CAN Bus (mrm-esp32).

Task

GPIO, General Purpose Input-Output, is the simplest function of board's pins. By using Arduino function digitalOut() we can connect it to 3.3 V or 0 V. Here is a simple code:

void setup() {
  pinMode(2, OUTPUT);
}

void loop() {
  digitalWrite(2, false);
  delay(500);
  digitalWrite(2, true);
  delay(500);
}
Enter the code in Arduino IDE and press upload button (leftmost, the Nike one). After setting the pin to be output, program will toggle its output voltage each 500 ms. Instead of (GPIO) 2, we can use 15, to toggle the other user LED.

Limitations

Some pins are not available for output. Check this list.