Freenove / Freenove_Ultimate_Starter_Kit_for_ESP32

Apply to FNK0047
Other
147 stars 47 forks source link

Sketch_01.1_Blink issue #11

Closed stevekirkby closed 5 months ago

stevekirkby commented 5 months ago

When GPIO 2 is HIGH, IO2 is LOW, so the earlier IO2 blink sketch cannot be used to make the LED blink correctly in this sketch.

The Blink files in each starter kit and the PDF should be updated.

Changes: LED_BUILTIN changed to PIN_LED digitalWrite High comment corrected to state LED is turned ON digitalWrite LOW comment corrected to state LED is turned OFF

I've also altered the delay values (1500, 500) to emphasie the HIGH/LOW states.

Apologies, I'm not very good at using github. I should probably inform you of these issues in a better way.

/**********************************************************************
* Filename    : Blink
* Description : Make an led blink.
* Auther      : www.freenove.com
* Modification: 2024/06/18
**********************************************************************/
#define PIN_LED  2
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(PIN_LED, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(PIN_LED, HIGH);   // turn the LED ON (HIGH is the voltage level)
  delay(1500);                       // wait for a second
  digitalWrite(PIN_LED, LOW);    // turn the LED OFF by making the voltage LOW
  delay(500);                       // wait for hald a second
}
Zhentao-Lin commented 5 months ago

ESP32_Pinout_1 6 In the old version, digitalWrite High means LED is turned ON, digitalWrite LOW means LED is turned OFF. ESP32_Pinout_V3 0 In the latest version, digitalWrite LOWmeans LED is turned ON, digitalWrite HIGH means LED is turned OFF.

I'm sorry if this has caused you any confusion.