0

I want to write code for my Arduino in Lua. Where I can find the necessary (pins) I/O lib and examples for Arduino IDE?
UPD: I've got arduino mega with many memory.

  • 1
    You want to code in Lua? And have that code run on the Arduino? Which Arduino do you have in mind? – Nick Gammon Mar 20 '16 at 19:52
  • @NickGammon , that's true, I want to write program for arduino uno. – val says Reinstate Monica Mar 20 '16 at 20:18
  • @NickGammon: ok, now I've got an arduino mega. – val says Reinstate Monica Aug 17 '16 at 16:40
  • 1
    It looks like the ESP8266 runs Lua, but I haven't seen it running on an Arduino. – Nick Gammon Aug 17 '16 at 21:57
1

Lua is an interpreted language. That is, the compile phase turns Lua source code into intermediate "pseudo-code" which the Lua interpreter then runs. It doesn't compile into machine code, and therefore there is nothing that could be uploaded to your Uno as a "hex" file.

In any case, with only 2 KB of RAM, it wouldn't be very practical to attempt to run Lua on a Uno. I like Lua personally, but running it on the (AVR) Arduinos just isn't practical.

  • Lua is a language (a spec of syntax and semantics). Its most widespread implementation is an interpreter, but there is nothing in the Lua language that prevents one from writing a compiler that emits Arduino code (or any other code). I find it actually unexpected that no one has made it yet. – Gabriel Mar 15 '18 at 12:49
0

AFAIK, Arduino IDE supports C++ only. You can use other languages to communicate with Arduino from your PC. Take a look at Firmata.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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