Add sensor button, fix sensor code.
This commit is contained in:
@ -6,6 +6,7 @@ runoncepath("/lib/throttle").
|
||||
runoncepath("/lib/node").
|
||||
runoncepath("/lib/stabilize_rocket").
|
||||
runoncepath("/lib/launch_rocket").
|
||||
runoncepath("/lib/sensors").
|
||||
|
||||
clearguis().
|
||||
|
||||
@ -36,6 +37,21 @@ set btn:ONTOGGLE to {
|
||||
}
|
||||
}.
|
||||
|
||||
MakeMenu(
|
||||
stk,
|
||||
MakeButton(rows[0], "SENSOR"),
|
||||
List(
|
||||
List("Pressure", "RO", "-1"),
|
||||
List("Temperature", "RO", "-1"),
|
||||
List("Acceleration", "RO", "-1"),
|
||||
List("Gravity", "RO", "-1"),
|
||||
List("Light", "RO", "-1")
|
||||
),
|
||||
"Refresh",
|
||||
refreshSensors@,
|
||||
refreshSensors@
|
||||
).
|
||||
|
||||
MakeMenu(
|
||||
stk,
|
||||
MakeButton(rows[0], "CONF"),
|
||||
@ -124,3 +140,12 @@ MakeMenu(
|
||||
|
||||
iface:show().
|
||||
wait until false.
|
||||
|
||||
function refreshSensors {
|
||||
parameter options.
|
||||
set options["Pressure"]:TEXT to ReadSensor("PRES"):TOSTRING.
|
||||
set options["Temperature"]:TEXT to ReadSensor("TEMP"):TOSTRING.
|
||||
set options["Acceleration"]:TEXT to ReadSensor("ACC"):TOSTRING.
|
||||
set options["Gravity"]:TEXT to ReadSensor("GRAV"):TOSTRING.
|
||||
set options["Light"]:TEXT to ReadSensor("LIGHT"):TOSTRING.
|
||||
}
|
||||
|
Reference in New Issue
Block a user