From 4b84e749adaa125aa3764632c263f1b84c49cc17 Mon Sep 17 00:00:00 2001 From: Peter Hall <33176108+IamPete1@users.noreply.github.com> Date: Tue, 25 Feb 2020 21:56:12 +0000 Subject: [PATCH] AP_Scripting: update LED_roll example --- libraries/AP_Scripting/examples/LED_roll.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Scripting/examples/LED_roll.lua b/libraries/AP_Scripting/examples/LED_roll.lua index 81de7ac04c..8db3028bd2 100644 --- a/libraries/AP_Scripting/examples/LED_roll.lua +++ b/libraries/AP_Scripting/examples/LED_roll.lua @@ -25,7 +25,8 @@ chan = chan + 1 gcs:send_text(6, string.format("LEDs: chan=" .. tostring(chan))) -- initialisation code -serialLED:set_num_LEDs(chan, num_leds) +--serialLED:set_num_neopixel(chan, num_leds) +serialLED:set_num_profiled(chan, num_leds) -- constrain a value between limits function constrain(v, vmin, vmax) @@ -76,7 +77,7 @@ function update_LEDs() local v = constrain(0.5 + 0.5 * math.sin(roll * (led - num_leds/2) / (num_leds/2)), 0, 1) set_Rainbow(chan, led, v) end - serialLED:send() + serialLED:send(chan) return update_LEDs, 20 -- run at 50Hz end