It is easy because someone already has written the code for the Arduino that is easy to modify. Ideally converting this code to Lua would be better. .