Ultra-simple beginner scripts apparently not working

I got my hands on an FC with 2MB flash for the first time, so I wanted to try out ‘this LUA thing’. The only results I was hoping to get from it were: Neopixel LED customization, custom tunes from the buzzer, and maybe some GCS messages based on certain flight parameter conditions.

All of that is really just for fun and to give this plane a personal touch. (Although I wouldn’t mind if it drags me in deeper into programming due to being fun.)

Unfortunately it turned out the Wiki is not quite up to date concerning LEDs, so I spent some time trying to get my Neopixel one to work with “set_num_LEDs( output_number , number_of_LEDs )” instead of “serialLED:set_num_neopixel”. Also some of the example scripts still had the old command. But finally I succeded in at least making them light up in different colours with:

serialLED:set_num_neopixel(13, 6)
serialLED:set_RGB(13, 0, 21, 131, 36)
serialLED:set_RGB(13, 1, 15, 131, 136)
serialLED:set_RGB(13, 2, 2, 131, 3)
serialLED:set_RGB(13, 3, 255, 255, 255)
serialLED:set_RGB(13, 4, 215, 0, 0)
serialLED:set_RGB(13, 5, 0, 0, 255)

Next I took a look at how to create loops in LUA and tried the following ones to get changing colours:

local colourcodearray = {0, 50, 100, 150, 200, 255}

for colour (colourcodearray) do

	serialLED:set_num_neopixel(13, 6)
	serialLED:set_RGB(13, 0, colour, colour, colour)
for colour = 1, 255, 1 do

	serialLED:set_num_neopixel(13, 6)
	serialLED:set_RGB(13, 1, colour, colour, colour)

local colour = 0

while true do

	colour = colour + 1

	serialLED:set_num_neopixel(13, 6)
	serialLED:set_RGB(13, 2, colour, colour, colour)

	if colour > 255 then


Unfortunately none of those has any effect - maybe it just happens too fast?

Same goes for my GCS message and buzzer tune tests, which in the end I set to play multiple times, hoping one would ‘get through’, but nothing happens.

for message = 1, 50, 1 do

gcs:send_text(1, 'HELLO 1')
gcs:send_text(6, 'HELLO 2')
gcs:send_text(0, 'HELLO 3')


for music = 1, 10, 1 do

local MYTUNE = "MBT200L7<<FG#>C#2FG#>C#2"



I put all of this into one script, it’s a bit annoying at least the working LED part only runs with USB disconnected and after rebooting the FC with battery connected, so I didn’t want to fiddle around with more than one file, which I was uploading dozens of times this way.

I’m aware this is extremely basic stuff, but that’s why I think even I should be able to to get it working. :wink: