Chat freely about anything...

User avatar
By LadyDee852
#48711 Hey, folks! I'm very new to all of this, and I've been doing a lot of research on different ways to set up a development environment for the ESP. I was hoping someone here could help me understand the pros/cons of using the toolchain and programming with C. I've looked at programming the module with the aid of NodeMCU and Lua, as well as connecting the module as a WiFi adapter to other microcontrollers, but I can't find too much information that really explains the benefit of using a C programming environment. I know this is a totally ignorant question for many of you, but a breakdown would be so helpful! =)
User avatar
By lotus49
#48791 Lua is a scripted language and is probably easier to use if you are a beginner and don't have much or any C knowledge. It's a higher level language than C but this brings with it drawbacks in terms of lack of functionality and the size of the code.

Programming in C will give you much greater control over the device and your programs. It's probably more difficult as a beginner, particularly if you have little or no programming experience.

If you are just playing around with the ESP8266 or doing very simple projects and have limited programming experience then Lua is probably the way to go. If you are doing anything complex and either know C already or would like to develop a knowledge of a widely used language, C would be the better choice.
User avatar
By LadyDee852
#48803 Thank you, lotus49. I have some experience with C... some. I'm actually a student, so the more I can learn from the ground up, the better. Any advice you can offer regarding the way either of the languages can impact the firmware on the MCU? I know that C compiles the code, while Lua uses as interpreter. I believe NodeMCU is the firmware that allows us to use the Lua scripting language. Does that mean we are rewriting the firmware by using C or is it the same in both scenarios?
User avatar
By lotus49
#48841 That's right. When you use C you are re-writing the firmware which will replace the NodeMCU or AT command firmware (whichever your ESP comes with). It's easy enough to put back should you wish to do so later on.

I haven't used Lua in anger but I've read enough about its limitations to put me off and since I already know C well, that was the obvious choice. The ability to program fluently in C is a useful and transferrable skill. Lua, not so much.