Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm planning to buy an Esp 8266.

Do I really need to learn lua script to play with it ? I have seen some people using it with the standard arduino ide...

Do you need a custom firmware to use arduino ide instead of lua script ?

Arduino ide seems better for me because I already know the syntax. Is there any downside of using arduino ide instead of NodeMCU with lua script ?

share|improve this question
up vote 3 down vote accepted

Using the Arduino IDE is custom firmware. That's what you're writing. You don't need any new firmware because the new firmware is what you are writing.

I can't think of any down sides to using C++ to program the ESP8266 instead of LUA - in fact it can only be a benefit since you are not using an interpreted language which is going to be slower than natively compiled code.

share|improve this answer
    
so why are most people using NodeMCU with Lua ? – n0tis Jan 26 at 16:19
    
@n0tis Because it's pre-installed and very easy to use. Also they're told to use it when they buy it and don't know any better. – Majenko Jan 26 at 16:19
    
so I should use this lua? I'm planning to make a mini robot using small motor, small battery and pwm – n0tis Jan 26 at 16:21
    
@n0tis I have only ever programmed them in C++ and wouldn't do anything else. At the end of the day you can always re-install the LUA interpreter firmware and go back to LUA if you don't get on with the Arduino-style programming of it. Nothing is permanent - you can change your mind any time you like. – Majenko Jan 26 at 16:22
1  
Yes, you just compile and upload. The lua firmware, or the AI thnker AT firmware are both just programs uploaded to the board: one to interpret Lua script, the other to interpret AT commands. Just like your Arduino sketches. – Majenko Jun 11 at 19:18

Maybe this instruction can help you: https://github.com/esp8266/Arduino

It talks about a ESP8266 IOT product called Wio Link

and you can try makeEspArduino. It is a generic makefile for any ESP8266 Arduino project. Using make instead of the Arduino IDE makes it easier to do automated and production builds.

share|improve this answer

Lua, like many scripting languages, tends to make you a lot more productive as a programmer: things become far easier as you work at a higher abstraction level and do not worry about trivial things like memory management. You achieve the same goals with far less lines of code. On the other hand, whereas it makes development faster, it also makes program execution slower. Whether this is a good trade-off or not is very dependent on the particular application you want to write.

In your particular case, you also have to consider the fact that you do not know Lua, and you already know both the C++ language and the Arduino API. Then you may not rip the benefits of Lua on a single project, because of the time needed to learn the language. You may consider learning the language as an investment, probably worth it if you are going to program a lot on this platform, probably not worth it if it's only for a single, simple enough project. If unsure, I suggest you take a look at the API provided with Lua on this platform: how well does it fit your project? Is it a significantly better fit than the Arduino API?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.