LED blink using M5stack

Last Updated on February 3, 2020 by technoreview85

It is a short article & code for LED blink .it is similar to Arduino led blink code. just you have to add two include the m5stack library.

Connect LED(+) to M5stack G21 & (-) to GND

#include <M5Stack.h>
/***
 * LED Blinking

const int ledPin = 21;
void setup() {
  // setup pin 5 as a digital output pin
  pinMode (ledPin, OUTPUT);
}
void loop() {
  digitalWrite (ledPin, HIGH);  // turn on the LED
  delay(500); // wait for half a second or 500 milliseconds
  digitalWrite (ledPin, LOW); // turn off the LED
  delay(500); // wait for half a second or 500 milliseconds
m5.update();
}

Here is the tutorial for programming m5stack using Arduino IDE

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *