ESP8266 running NodeMCU as a controller


jscottb over at LetsMakeRobots writes:

My goal for this mini project is to create A simple autonomous rover with just the ESP and NodeMCU. In looking at the specs for node most of the supporting libraries already written. GPIO, PWM and Timer libraries are included in the Lua interpreter.
After flashing the board my next up was to write the base code I would use for the bot. My first step in writing it was the stub out something I could test locally on my machine with standard Lua. I did this by making fake functions for the GPIO and tmr classes. This allowed me to check my code for syntax errors before uploading to the board. After this is done, the code was uploaded and verified with the real Node Lua.
I decided to write the code similar to processing and Arduino code with a setup and loop function. Outside of that, I have four functions and they are as follows; forward, back_up, turn_left and read_usonic.

Project info at LetsMakeRobots blog.

Check out the video after the break.

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.