Skip to content

Instantly share code, notes, and snippets.

@nurikk
Last active May 21, 2023 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nurikk/f79df7b75a70ef6e573162a0fb0fa69d to your computer and use it in GitHub Desktop.
Save nurikk/f79df7b75a70ef6e573162a0fb0fa69d to your computer and use it in GitHub Desktop.

About

Enable expresslrs ble joystic on any switch. It will save your time if you're flying in sym a lot and have bunch of unused switches on your radio.

Installation

  1. Copy script to /SCRIPTS/FUNCTIONS/ble.lua
  2. Create global function on any channel you want and select Lua Script and select ble
  3. Have fun! :)

Tested on

  • elrs 3.2.1, tx16s, edgetx 2.8.2
local deviceId = 0xEE
local handsetId = 0xEF
local bleWorking = false
-- reverse ingenered bleFieldId, this field can and will change in future versions. ned proper initialisation
local bleFieldId = "23"
local commanStatusRunning = 1
local commanStatusCancell = 5
local paramWrite = 0x2D
local function run()
if (not bleWorking) then
crossfireTelemetryPush(paramWrite, {deviceId, handsetId, bleFieldId, commanStatusRunning})
playTone(2000, 100, 1000)
bleWorking = true
end
end
local function background()
if (bleWorking) then
crossfireTelemetryPush(paramWrite, {deviceId, handsetId, bleFieldId, commanStatusCancell})
playTone(3000, 100, 1000)
bleWorking = false
end
end
return {run = run, background = background}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment