I'm using a NodeMCU board, V3 pinout, and the Arduino IDE. I need to oscillate one of the output pins, and digging around I found this page: https://github.com/nodemcu/nodemcu-firmware/blob/master/docs/en/modules/gpio.md
Very useful, especially the gpio.serout()
function, but I can't get it to work. This is my code:
#include <gpio.h>;
#define LED D5
void setup() {
gpio.mode(LED, OUTPUT);
Serial.begin(9600);
}
void loop() {
Serial.write("Starting blinking.");
gpio.serout(LED, HIGH, 1000000, 10);
Serial.write("Done.");
}
The #include <gpio.h>;
is a guess of mine after the compiler threw the error 'gpio' was not declared in this scope
but the error remains. The file gpio.h
obviously imports fine, or it'd complain about that. All I can find is code snippets like the manual page linked to above, no complete sketches.
Any way to get to use these gpio
functions?