lua.py

Created by lilian-besson-1

Created on May 23, 2025

1.07 KB

Example of a Lua script, to be read by the Lua interpreter NWA app.


-- This is NOT a Python script
-- This is a Lua file!

eadk_color_black = 0x0
eadk_color_white = 0xFFFF
eadk_color_red = 0xF800
eadk_color_green = 0x07E0
eadk_color_blue = 0x001F

print("Hello world from Lua! Testing.\n")
print("Hello world from Lua! Testing.\n")
print("Hello world from Lua! Testing.\n")
eadk.timing_msleep(1000)

for j=1,1 do
  -- Just a comment here
  for i=1,2 do
    eadk.display_draw_string("Hello", 10*i, 10*i+20*j, 1) -- 1 for true, for large font
  end
  for i=3,4 do
    eadk.display_draw_string("Hello", 10*i, 10*i+20*j, 0) -- 0 for false, for small font
  end
  for i=5,6 do
    eadk.display_draw_string("Hello", 10*i, 10*i+20*j, 0) -- 0 for false, for small font
  end
  i = 7
  eadk.display_draw_string("Hello", 10*i, 10*i+20*j, 0, eadk_color_red) -- 0 for false, for small font
  i = i + 1
  eadk.display_draw_string("Hello", 10*i, 10*i+20*j, 0, eadk_color_green) -- 0 for false, for small font
  i = i + 1
  eadk.display_draw_string("Hello", 10*i, 10*i+20*j, 0, eadk_color_blue) -- 0 for false, for small font
  i = i + 1

  eadk.timing_msleep(1000)
end

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.