Skip to content

ESP8266 Blink example for the blue LED on the ESP-01 module #461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 26, 2015

Conversation

probonopd
Copy link
Contributor

No description provided.


void setup() {
pinMode(ledPin, OUTPUT); // Initialize the ledPin as an output
ESP.wdtDisable(); // Disable the watchdog timer built into the ESP8266
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not necessary — works fine with WDT enabled.

@probonopd
Copy link
Contributor Author

Changed as you advised, thanks.

@igrr
Copy link
Member

igrr commented Jun 21, 2015

Another thing is, all Arduino boards have BUILTIN_LED defined in pins_arduino.h.
For 'generic' variant this is defined like this:

static const uint8_t BUILTIN_LED = 1;

Other variants (NodeMCU, MOD-WIFI, HUZZAH) also have this defined, so the sketch can use this constant instead of fixed pin number, and this will work on all boards. I really wonder why the standard Blink sketch doesn't do this...

@probonopd
Copy link
Contributor Author

Using BUILTIN_LED now.

Contributing to this project is fun because one learns so many things. I think the project can profit much from having great examples coming with it.

igrr added a commit that referenced this pull request Jun 26, 2015
ESP8266 Blink example for the blue LED on the ESP-01 module
@igrr igrr merged commit 2e1484e into esp8266:esp8266-sdk-1.0 Jun 26, 2015
@liquiddandruff
Copy link

My esp12e doesn't seem to listen when I digitalWrite high/low to pin BUILTIN_LED, nothing happens. I'll investigate later. Great comments by the way, didn't know the led is supposed to activate on low.

@Protoneer
Copy link
Contributor

Yes... I seem to have the same issue. Strange thing is that the
ESP8266->Blinky seems to work but when I use one of the wifi libs its stops
reacting to digital High and Low.
On 26/08/2015 10:46 pm, "Steven Huang" [email protected] wrote:

My esp12e doesn't seem to listen when I digitalWrite high/low to pin
BUILTIN_LED, nothing happens. I'll investigate later. Great comments by the
way, didn't know the led is supposed to activate on low.


Reply to this email directly or view it on GitHub
#461 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants