Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature may not be available in some browsers.
Versie 0.4
![]()
Visuele wijzigingen, daarom nu ook een paar BMP's nodig.
ZIPFILE: http://www.richardoe.nl/BMP.zip
uitpakken in SCRIPTS folder, dus de bmp files moeten komen in <SDCARD>SCRIPTS\BMP\*
Code hieronder moet op SD card in folder: /Scripts/<modelname>/telem1.lua
Code:-- ############################################################### -- # # -- # Telemetry Lua Script Naze32, version 0.4 # -- # # -- # + naze32 telemetry enabled # -- # + tested with D4r-II # -- # # -- # License (Script & images): Share Alike # -- # Can be used and changed non commercial # -- # # -- # Inspired by SockEye # -- # Questions: [email]Richard@hetnet.nl[/email] # -- # # -- ############################################################### local function run(event) -- The 0% value for 2S, 3S, 4S, you can change these to your own likings. local four_low=13.5 local three_low=10.2 local two_low=6.9 -- The 100% value for 2S, 3S, 4S, , you can change these to your own likings. local four_high=16.5 local three_high=12.5 local two_high=8.5 -- NO changes needed below here, except when using different switch for flight mode (I use SG) change line: -- if getValue(MIXSRC_SG)<0 then local battype = 3 local battypestr="_S" local percent=0 local batt_sum = getValue("cell-sum") if batt_sum>3 then battype=math.ceil(batt_sum/4.25) if battype==4 then battypestr="4S" percent = (batt_sum-four_low)*(100/(four_high-four_low)) end if battype==3 then battypestr="3S" percent = (batt_sum-three_low)*(100/(three_high-three_low)) end if battype==2 then battypestr="2S" percent = (batt_sum-two_low)*(100/(two_high-two_low)) end end -- local percent = 8 -- for simulation only local myPxHeight = math.floor(percent * 0.37) local myPxY = 11 + 37 - myPxHeight lcd.drawPixmap(3, 1, "/SCRIPTS/BMP/battery.bmp") if percent > 0 then lcd.drawFilledRectangle(8, myPxY, 21, myPxHeight, FILL_WHITE ) end local i = 36 while (i > 0) do lcd.drawLine(7, 11 + i, 27, 11 +i, SOLID, GREY_DEFAULT) i= i-2 end if (percent < 15) then lcd.drawNumber(4,55, batt_sum * 100 ,PREC2 + LEFT + BLINK) else lcd.drawNumber(4,55, batt_sum * 100 ,PREC2 + LEFT) end lcd.drawText(lcd.getLastPos(), 55, "v ", 0) lcd.drawText(lcd.getLastPos(), 55,battypestr,0) -- ############################################################### -- TIMERS -- ############################################################### local timer = model.getTimer(0) lcd.drawText(40, 1, "TIMER1", 0) lcd.drawTimer(40, 11, timer.value, MIDSIZE) timer = model.getTimer(1) lcd.drawText(40, 31, "TIMER2", 0) lcd.drawTimer(40, 41, timer.value, MIDSIZE) -- ############################################################### -- FLIGHTMODE -- ############################################################### lcd.drawPixmap(78, 1, "/SCRIPTS/BMP/fm.bmp") if getValue(MIXSRC_SG)<0 then lcd.drawText(98,1,"Horizon",MIDSIZE) elseif getValue(MIXSRC_SG) == 0 then lcd.drawText(98,1,"Acro",MIDSIZE) else lcd.drawText(98,1,"Angle",MIDSIZE) end -- ############################################################### -- Displays xyz data -- ############################################################### lcd.drawText(80,31,"x-AS: ",0) lcd.drawText(120,31,getValue("accx"),0) lcd.drawText(80,40,"y-AS: ",0) lcd.drawText(120,40,getValue("accy"),0) lcd.drawText(80,49,"Z-AS: ",0) lcd.drawText(120,49,getValue("accz"),0) -- ############################################################### -- Displays RSSI data -- ############################################################### if getValue("rssi") > 38 then percent = ((math.log(getValue("rssi")-28, 10)-1)/(math.log(72, 10)-1))*100 else percent = 0 end if percent > 90 then lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI10.bmp") elseif percent > 80 then lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI09.bmp") elseif percent > 70 then lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI08.bmp") elseif percent > 60 then lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI07.bmp") elseif percent > 50 then lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI06.bmp") elseif percent > 40 then lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI05.bmp") elseif percent > 30 then lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI04.bmp") elseif percent > 20 then lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI03.bmp") elseif percent > 10 then lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI02.bmp") elseif percent > 0 then lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI01.bmp") else lcd.drawPixmap(164, 1, "/SCRIPTS/BMP/RSSI00.bmp") end lcd.drawChannel(178, 55, 200, LEFT) lcd.drawText(lcd.getLastPos(), 56, "dB", SMLSIZE) end return { run=run }
even dubbelcheck gedaan, script 1 op 1 gezet in F550 model. daar heb ik ook de x8r en de flvss op zitten en dat werkt. na armen zie ik de battery, rssi, timer. Flightmode is natuurlijk fout.
cell-sum etc zit het dus niet in.
Dus blijft over,
of
je hebt iets aangepast in script.
of
andere Firmware, ik zit op 2.0.8 openTX
of
alle plaatjes erin gezet?
of ik zie iets over het hoofd nu, dus ik zou het script 1 op 1 overnemen en als je dan dingen wilt aanpassen laat t even weten dan wil ik je wel helpen.
lcd.drawText(40, 31, "TIMER2", 0)
lcd.drawTimer(40, 41, timer.value, MIDSIZE)
local function run(event)
lcd.drawTimer(40, 41, getValue("clock"), MIDSIZE)
end
return { run=run }
Het werkt bij mij nu ook op de zender met onderstaande code. kan blijkbaar niet met timer overweg. Graag even bij jou testen, denk dat het nu goed is.
Dit zijn de 2 goede regels.
Code:lcd.drawText(40, 31, "Tijd", 0) lcd.drawChannel(40, 41, (190), MIDSIZE + LEFT)
local batt_sum = getValue("cell-sum")
local batt_sum = getValue("cell-sum") + 0.1
Foto? Die je nu geplaatst hebt is 1 x 1 pixel, zogoed zijn mijn ogen niet![]()