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.

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

2 Answers 2

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.

1
  • 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. Commented Mar 15, 2018 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.

1
  • An enterprising person might cross compile Lau to C++ ... Once upon a time our AT&T C++ compiler only emmitted C and the cc command turned that into object coed. Commented Jul 30, 2023 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.