Adafruit ESP32-S3 Manual page 198

Tft feather
Table of Contents

Advertisement

// Some boards work best if we also make a serial connection
Serial.begin(115200);
// set LED to be an output pin
pinMode(led, OUTPUT);
}
void loop() {
// Say hi!
Serial.println("Hello!");
digitalWrite(led, HIGH);
delay(500);
digitalWrite(led, LOW);
delay(500);
}
Note that in this example, we are not only blinking the LED but also printing to
the Serial monitor, think of it as a little bonus to test the serial connection.
One note you'll see is that we reference the LED with the constant
rather than a number. That's because, historically, the built in LED was on pin 13 for
Arduinos. But in the decades since, boards don't always have a pin 13, or maybe it
could not be used for an LED. So the LED could have moved to another pin. It's best
to use
LED_BUILTIN
The LED is available as
Verify (Compile) Sketch
OK now you can click the Verify button to convert the sketch into binary data to be
uploaded to the board.
Note that Verifying a sketch is the same as Compiling a sketch - so we will use the
words interchangeably
During verification/compilation, the computer will do a bunch of work to collect all the
libraries and code and the results will appear in the bottom window of the IDE.
©Adafruit Industries
// turn the LED on (HIGH is the voltage level)
// wait for a half second
// turn the LED off by making the voltage LOW
// wait for a half second
so you don't get the pin number confused!
, but it is on pin
LED_BUILTIN
LED_BUILTIN
.
13
Page 198 of 263

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S3 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF