Esempio n. 1
0
         steps = 3310
 parser.read(CONF)
 if (parser['inserttest_config']['insert_section'] == 'middle'):
     if (parser['inserttest_config']['size'] == '5'):
         steps = 5241
     if (parser['inserttest_config']['size'] == '5.5'):
         steps = 4689
     if (parser['inserttest_config']['size'] == '7'):
         flag == 1
         steps = 4413
 x=1
 speed=.001
 slowpoint = (steps) *0.75
 #1000ms = 14.5/16ths of an inch on input resolution of 200
     
 DAQC2.toggleDOUTbit(7,0)
 if flag == 1:
 for x in range(steps):
     print(x)
     DAQC2.toggleDOUTbit(7,2)
     x=x+1
     if x==(int(slowpoint)):
         speed=.005
         time.sleep(speed)
     if flag == steps:
         flag == 0
 DAQC2.toggleDOUTbit(7,1)
         
 speed=.001
         
 for x in range(steps):
Esempio n. 2
0
     resp['bit'] = bit
     resp['state'] = 1
 elif (cmd == "clrDOUTbit"):
     bit = args['bit']
     try:
         DP.clrDOUTbit(addr, bit)
     except AssertionError:
         DP2.clrDOUTbit(addr, bit)
     resp['bit'] = bit
     resp['state'] = 0
 elif (cmd == "toggleDOUTbit"):
     bit = args['bit']
     try:
         DP.toggleDOUTbit(addr, bit)
     except AssertionError:
         DP2.toggleDOUTbit(addr, bit)
     resp['bit'] = bit
     resp['state'] = 'UNKNOWN'
 elif (cmd == "getADC"):
     channel = args['channel']
     try:
         voltage = DP.getADC(addr, channel)
     except AssertionError:
         voltage = DP2.getADC(addr, channel)
     resp['channel'] = channel
     resp['voltage'] = voltage
 elif (cmd == "getTEMP"):
     bit = args['bit']
     scale = args['scale']
     try:
         temp = DP.getTEMP(addr, bit, scale)