Hi,
I'm trying to write (copy, past from various sources) a lua script that displays the models location and also writes the last valid location to a txt file. This is so that the location can be read in the field in the case of a lost model and entered into a smart phone geolocator app. This is particularly valid for slope soaring where the slope can be vast and the bracken 6ft high. with no pen usually available the data will be lost if the TX is turned off . I know the data could be available in the log files but these are not easily read on top of a hill.
I can display the gps data on a telemetry screen via the script but cannot get it to be written to a txt file. Help please what am I missing? Help
background() -- update current GPS position
lcd.drawText(1,11,"GPS:", 0)
lcd.drawText(lcd.getLastPos()+2,11,gpsValue,0)
if (type(gpsValue) == "table") then
local gnfile = io.open("lstgps.txt", "w")
gnfile.write(gpsValue)
gnfile:flush()
gnfile:close()
end
end
lua script save gps to file
Help with any software/desktop related issues. e.g. companion9x, eePe, etc
Jump to
- OPENRC News & Information
- ↳ General Information & Rules
- ↳ Feedback
- General help and information
- ↳ Software
- ↳ Hardware
- ↳ General help (FrSky Taranis radio)
- Open Radio Control Transmitter Firmwares
- ↳ General model setup questions
- ↳ er9x / gruvin9x / th9 based firmwares
- ↳ Template Library
- ↳ Splash Screen Library
- ↳ Helicoptor Programming
- ↳ radioclone
- ↳ stock firmware (fly sky th9x)
- ↳ Template Library
- ↳ Sound Pack Library
- ↳ Edge TX
- ↳ openTx
- ↳ openTx for FrSky radios
- ↳ openTx model setup
- ↳ er9x
- ↳ er9x model setup
- ↳ ersky9xr
- ↳ erskyTx (was ersky9x)
- ↳ ersky9x model setup
- ↳ gruvin9x
- ↳ gruvin9x model setup
- ↳ th9x
- ↳ th9x model setup
- ↳ gv9x
- ↳ radioclone
- ↳ radioclone model setup
- ↳ tgy9xr
- ↳ tgy9xr model setup
- ↳ AR-T6
- ↳ other
- Desktop Software to Program Your Transmitter
- ↳ eePe
- ↳ companion9x
- ↳ eepSKYe
- Open Radio Control RF Systems & Hardware
- ↳ OpenLRS
- ↳ OpenLRSng
- ↳ OpenLRSng hardware
- Closed Source Radio Control RF Systems & Hardware
- ↳ Royal Way - Rlink UHF Long Range System
- Transmitter Hardware
- ↳ FlySky TH9X / Turnigy 9X / Eurgle 9X radio
- ↳ SMARTIEPARTS PROGRAMMER
- ↳ HARDWARE MODS & HACKS
- ↳ FRSky Telemetry Mods
- ↳ ArduPilot Mods
- ↳ Electronic Mods
- ↳ Hardware Mods
- ↳ Soldering, Hardware, Skills
- ↳ DSM2/DSMX Mods
- ↳ UPGRADE BOARDS
- ↳ sky9x upgrade board
- ↳ gruvin9x upgrade board
- ↳ 9Xtreme upgrade board
- ↳ RF MODULES
- ↳ The FRSKY Forum
- ↳ PROGRAMMERS
- ↳ FrSky Taranis radio
- ↳ FRSky Horus radio
- ↳ Turnigy 9XR PRO radio
- ↳ Orange DSM Telemetry module
- ↳ Turnigy 9XR radio
- ↳ PROGRAMMERS
- ↳ Other Radios
- ↳ Retro Radios
- Other OPEN Projects
- ↳ General RC Electronic Projects and Discussion
- ↳ OpenXVario - an open source vario supported by the open source firmwares!!
- ↳ Other Electronic Projects
- ↳ OpenFlightStab
- ↳ OpenLRSng
- ↳ 3D Printing
- Other Forums
- ↳ The Pickled Gnu (The Pub)
- ↳ FPV Projects
- ↳ Reviews
- ↳ Where to buy / Spares / Modules? Selling up?
- Links
- ↳ er9x on Google Code
- ↳ ersky9x on Github
- ↳ Gruvin9x on Google Code
- ↳ th9x on Google Code
- ↳ openTx on Google Code
- ↳ gv9x on Google Code
- ↳ radioclone on Sourceforge
- ↳ eePe on Google Code
- ↳ companion9x on Google Code
- ↳ 9X Guides
- ↳ openxvario