mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
some examples
This commit is contained in:
parent
aa824937f9
commit
ede064d993
6 changed files with 125 additions and 0 deletions
24
examples/mepo_mc_gps.py
Executable file
24
examples/mepo_mc_gps.py
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/python
|
||||
DISPLAYNAME="Center at MC node location"
|
||||
|
||||
from meshcore import BLEConnection
|
||||
from meshcore import MeshCore
|
||||
import asyncio
|
||||
|
||||
ADDRESS = "t1000"
|
||||
|
||||
async def main () :
|
||||
con = BLEConnection(ADDRESS)
|
||||
await con.connect()
|
||||
mc = MeshCore(con)
|
||||
await mc.connect()
|
||||
|
||||
infos = mc.self_info
|
||||
|
||||
lat=infos["adv_lat"]
|
||||
lon=infos["adv_lon"]
|
||||
|
||||
print('[{"cmd":"prefset_n","args":{"pref":"lat","value":' + str(lat) + '}},')
|
||||
print('{"cmd":"prefset_n","args":{"pref":"lon","value":' + str(lon) + '}}]')
|
||||
|
||||
asyncio.run(main())
|
||||
Loading…
Add table
Add a link
Reference in a new issue