如何运行这个Python程序 [英] How to run this Python program
本文介绍了如何运行这个Python程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请你帮我找一下UUGearDevice usb设备ID以及如何添加到python程序。我对python一无所知。我打开了voltageMeasrement.py,但我现在不知道如何添加设备ID,当我运行该程序时,它显示UUgear设备未正确初始化。这里是代码
来自时间 import sleep
来自 UUGear import *
UUGearDevice.setShowLogs( 0 )
device = UUGearDevice(' UUGear-Arduino -7853-2668')
if device.isValid():
for i 范围内( 100 ):
print %0.2f%(浮点数(设备) .analogRead( 3 ))* 5 / 1024 ), V
sleep( 0 。 2 )
device.detach()
device.stopDaemon()
else :
print ' UUGear设备未正确初始化。'
解决方案
请参阅 https:// www .google.com / search?q = UUGearDevice [ ^ ]。
Can u please help me to find the UUGearDevice usb device id and how to a add to python program. i dont know nothing about python. i opened the voltageMeasrement.py but i dont know how to add the device id to it now when i run that program it is showing that "UUgear device is not correctly initialized . here is the code
from time import sleep
from UUGear import *
UUGearDevice.setShowLogs(0)
device = UUGearDevice('UUGear-Arduino-7853-2668')
if device.isValid():
for i in range(100):
print "%0.2f" % (float(device.analogRead(3)) * 5 / 1024), "V"
sleep(0.2)
device.detach()
device.stopDaemon()
else:
print 'UUGear device is not correctly initialized.'
解决方案
See https://www.google.com/search?q=UUGearDevice[^].
这篇关于如何运行这个Python程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文