Last active
September 24, 2020 03:22
-
-
Save Jamesits/a3c128d050e6d3a16e9a to your computer and use it in GitHub Desktop.
Blink for ESP8266 ESP-12E NodeMCU 1.0 Board, Arduino IDE: Hello world and function tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See the comment for flashing instruction. | |
#include <ESP8266WiFi.h> | |
#define ONBOARD_LED 16 | |
#define ESP8266_LED 2 | |
// ADC_MODE(ADC_VCC); will result in compile error. use this instead. | |
int __get_adc_mode(void) { return (int) (ADC_VCC); } | |
void setup() | |
{ | |
pinMode(ONBOARD_LED, OUTPUT); | |
pinMode(ESP8266_LED, OUTPUT); | |
Serial.begin(115200); | |
// Print Wi-Fi Information | |
WiFi.printDiag(Serial); | |
// Print VCC voltage | |
Serial.print("Current VCC: "); | |
Serial.println(ESP.getVcc()); | |
} | |
void loop() | |
{ | |
digitalWrite(ONBOARD_LED, HIGH); | |
digitalWrite(ESP8266_LED, HIGH); | |
Serial.println("LED on"); | |
delay(500); | |
digitalWrite(ONBOARD_LED, LOW); | |
digitalWrite(ESP8266_LED, LOW); | |
Serial.println("LED off"); | |
delay(500); | |
} |
Author
Jamesits
commented
Mar 4, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment