-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_ft.py
35 lines (26 loc) · 808 Bytes
/
test_ft.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
import sys
import time
import rpi_ati_net_ft
def main():
sys.path.append('../src')
try:
if (len(sys.argv) < 2):
raise Exception('IP address of ATI Net F/T sensor required')
host=sys.argv[1]
netft=rpi_ati_net_ft.NET_FT(host)
netft.set_tare_from_ft()
print(netft.read_ft_http())
print(netft.try_read_ft_http())
netft.start_streaming()
while(True):
#print(netft.read_ft_streaming(.1))
res, ft, status = netft.try_read_ft_streaming(.1)
print("res: ", res)
print("ft: ", ft)
print("status: ", status)
time.sleep(0.5)
except KeyboardInterrupt:
pass
if __name__ == '__main__':
main()