本文整理汇总了Python中Phidgets.Devices.InterfaceKit.getOutputState方法的典型用法代码示例。如果您正苦于以下问题:Python InterfaceKit.getOutputState方法的具体用法?Python InterfaceKit.getOutputState怎么用?Python InterfaceKit.getOutputState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phidgets.Devices.InterfaceKit
的用法示例。
在下文中一共展示了InterfaceKit.getOutputState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: exit
# 需要导入模块: from Phidgets.Devices import InterfaceKit [as 别名]
# 或者: from Phidgets.Devices.InterfaceKit import getOutputState [as 别名]
print "Phidget Exception %i: %s" % (e.code, e.message)
try:
interfaceKit.closePhidget()
except PhidgetException, e:
print "Phidget Exception %i: %s" % (e.code, e.message)
print "Exiting...."
exit(1)
print "Exiting...."
exit(1)
print "Output Count: "+str(interfaceKit.getOutputCount())
time.sleep(3)
print "Output 0 is currently in state "+str(interfaceKit.getOutputState(0))
print "Press Enter to toggle output 0"
chr = sys.stdin.read(1)
if interfaceKit.getOutputState(0) is False:
print "setting output dtate to True"
interfaceKit.setOutputState(0, True)
print "done"
else:
print "setting output state to False"
interfaceKit.setOutputState(0, False)
print "done"
print "Press Enter to quit...."
chr = sys.stdin.read(1)
示例2: print
# 需要导入模块: from Phidgets.Devices import InterfaceKit [as 别名]
# 或者: from Phidgets.Devices.InterfaceKit import getOutputState [as 别名]
print('</table></td><td>')
#Print the Digital Input values
print('<b>Digital Input Values</b>')
print('<table border="1"><tr><td>Input Number</td><td>Input Value</td></tr>\n')
for i in range (0,8):
try:
print ('<tr><td>'+str(i)+'</td><td>'+str(ifk.getInputState(i))+'</td></tr>\n')
except:
pint('<tr><td>'+str(i)+'</td><td>Could not Read Digital Input State </td></tr>\n')
print('</table></td><td>')
#Print the Digital Output States
print('<b>Digital Output States</b>')
print('<table border="1"><tr><td>Output Number</td><td>Output State</td><td>Set True</td><td>Set False</td></tr>\n')
for i in range (0,8):
try:
print ('<tr><td>'+str(i)+'</td><td>'+str(ifk.getOutputState(i))+'</td><td><a href="SetTrue'+str(i)+'.py">Set True</a></td><td><a href="SetFalse'+str(i)+'.py">Set False</a></td></tr>\n')
except:
pint('<tr><td>'+str(i)+'</td><td>Could not Read Digital Outputt State </td></tr>\n')
print('</table></td></tr></table>')
print ('<br><br>This page does not automaticly refresh')
print ('<br><br><a href="WebInterfaceKit.py">Refresh this page</a>')
print('</body></html>\n')
ifk.closePhidget()
exit(0)