Skip to content

Commit

Permalink
display error info when no signal found
Browse files Browse the repository at this point in the history
  • Loading branch information
offer-shmuely committed Nov 16, 2024
1 parent 8c0b517 commit d565f24
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions sdcard/c480x272/SCRIPTS/TOOLS/Model Locator (by RSSI).lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@

-- Model Locator by RSSI
-- Offer Shmuely (based on code from Scott Bauer 6/21/2015)
-- Date: 2022
-- ver: 0.3
-- Date: 2022-2024
-- ver: 0.5
local app_ver = "0.5"

-- This widget help to find a lost/crashed model based on the RSSI (if still available)
-- The widget produce audio representation (variometer style) of the RSSI from the lost model
-- The widget produce audio representation (vario-meter style) of the RSSI from the lost model
-- The widget also display the RSSI in a visible colorized bar (0-100%)

-- There are two way to use it
Expand Down Expand Up @@ -137,27 +138,28 @@ local function getSignalValues()
-- return v, 0, 100
--end

lcd.drawText(30, 3, "Signal: not found in RSSI/1RSS/2RSS", 0)
return nil, 0, 0
end


local function main(event, touchState)
lcd.clear()

local signalValue, signalMin, signalMax = getSignalValues()
-- log(signalValue)
if signalValue == nil then
return
end
log("signalValue:" .. signalValue .. ", signalMin: " .. signalMin .. ", signalMax: " .. signalMax)

-- background
--lcd.drawBitmap(img, 0, 20, 30)
lcd.drawBitmap(img, 250, 50, 40)

-- Title
lcd.drawText(3, 3, "RSSI Model Locator", 0)
lcd.drawText(LCD_W - 50, 3, "ver: " .. app_ver .. "", SMLSIZE)

local signalValue, signalMin, signalMax = getSignalValues()
-- log(signalValue)
if signalValue == nil then
lcd.drawText(30, 50, "No signal found (expected: RSSI/1RSS/2RSS)", 0 + BLINK)
return 0
end
log("signalValue:" .. signalValue .. ", signalMin: " .. signalMin .. ", signalMax: " .. signalMax)

--if (rssi > 42) then
-- lcd.setColor(CUSTOM_COLOR, YELLOW) -- RED / YELLOW
Expand Down

0 comments on commit d565f24

Please sign in to comment.