|
|
@@ -55,7 +55,6 @@ class AppTest:
|
|
|
def cmd_sensor_cnt(self):
|
|
|
print("SENSOR CNT")
|
|
|
resp = self.serial_port.request(self.module, 0, CMD_SENSOR_CNT,[])
|
|
|
- print(resp)
|
|
|
return resp[3]
|
|
|
|
|
|
def cmd_sensor_type(self, index):
|
|
|
@@ -143,7 +142,11 @@ class AppTest:
|
|
|
|
|
|
def cmd_reset(self):
|
|
|
print("MODULE RESET")
|
|
|
- resp = self.serial_port.request(self.module, 0, (SET+CMD_RESET),[], long_answer=1)
|
|
|
+ resp = self.serial_port.request(self.module, 0, (SET+CMD_RESET),[], long_answer=0.3)
|
|
|
+
|
|
|
+ def cmd_store(self, sensor):
|
|
|
+ print("MODULE STORE PARAM")
|
|
|
+ resp = self.serial_port.request(self.module, sensor, (SET+CMD_STORE),[], long_answer=0.1)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
|
@@ -155,11 +158,17 @@ if __name__ == "__main__":
|
|
|
if app.cmd_echo([97,98,99,100]) == 0:
|
|
|
sys.exit()
|
|
|
|
|
|
- app.cmd_reset()
|
|
|
- #app.cmd_set_param(1, PARAM_SAMPLERATE, 10)
|
|
|
- #app.cmd_set_param(1, PARAM_RANGE, 1)
|
|
|
- #app.cmd_set_param(1, PARAM_FILTER, 2)
|
|
|
-
|
|
|
+ #app.cmd_reset()
|
|
|
+ store_param = False
|
|
|
+ if store_param:
|
|
|
+ app.cmd_set_param(1, PARAM_SAMPLERATE, 10)
|
|
|
+ app.cmd_set_param(1, PARAM_RANGE, 1)
|
|
|
+ app.cmd_set_param(1, PARAM_FILTER, 2)
|
|
|
+
|
|
|
+ app.cmd_store(1)
|
|
|
+
|
|
|
+ sys.exit()
|
|
|
+
|
|
|
for s in range(1):
|
|
|
sr=app.cmd_get_param(s+1,PARAM_SAMPLERATE)
|
|
|
r=app.cmd_get_param(s+1,PARAM_RANGE)
|
|
|
@@ -167,7 +176,7 @@ if __name__ == "__main__":
|
|
|
ee=app.cmd_get_param(s+1,PARAM_GAIN)
|
|
|
print(sr,r,lpf,ee)
|
|
|
|
|
|
- sys.exit()
|
|
|
+ # sys.exit()
|
|
|
#time.sleep(0.5)
|
|
|
#app.cmd_module_stop()
|
|
|
|
|
|
@@ -180,7 +189,7 @@ if __name__ == "__main__":
|
|
|
#sys.exit()
|
|
|
print("pocet senzorov=", pocet)
|
|
|
#app.cmd_sensor_get_data_FSR(pocet)
|
|
|
- for i in range(36):
|
|
|
+ for i in range(50):
|
|
|
acc = app.cmd_sensor_get_data_IMU(1)
|
|
|
gyr = app.cmd_sensor_get_data_IMU(2)
|
|
|
print(acc)
|