当前位置: 首页>>代码示例>>Python>>正文


Python Oscilloscope.supports_single_channel方法代码示例

本文整理汇总了Python中PyHT6022.LibUsbScope.Oscilloscope.supports_single_channel方法的典型用法代码示例。如果您正苦于以下问题:Python Oscilloscope.supports_single_channel方法的具体用法?Python Oscilloscope.supports_single_channel怎么用?Python Oscilloscope.supports_single_channel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyHT6022.LibUsbScope.Oscilloscope的用法示例。


在下文中一共展示了Oscilloscope.supports_single_channel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Oscilloscope

# 需要导入模块: from PyHT6022.LibUsbScope import Oscilloscope [as 别名]
# 或者: from PyHT6022.LibUsbScope.Oscilloscope import supports_single_channel [as 别名]
voltagerange = 10       # 1 (5V), 2 (2.6V), 5 or 10
samplerate = 24         # sample rate in MHz or in 10khz
numchannels = 1
numseconds = 8          # number of seconds to sample
blocksize = 6*1024      # should be divisible by 6*1024
alternative = 1         # choose ISO 3072 bytes per 125 us

scope = Oscilloscope()
scope.setup()
scope.open_handle()
scope.flash_firmware()
if (not scope.is_device_firmware_present):
    scope.flash_firmware()
else:
    scope.supports_single_channel = True;
print "Setting up scope!"

scope.set_interface(alternative);
print "ISO" if scope.is_iso else "BULK", "packet size:", scope.packetsize
print scope.set_num_channels(numchannels)
# set voltage range
scope.set_ch1_voltage_range(voltagerange)
# set sample rate
scope.set_sample_rate(samplerate)
# we divide by 100 because otherwise audacity lets us not zoom into it
samplerate = samplerate * 1000 * 10

print "Reading data from scope! in ",
for x in range(0, 3):
    print 3-x,"..",
开发者ID:baruch,项目名称:Hantek6022API,代码行数:32,代码来源:example_linux_recordwav.py


注:本文中的PyHT6022.LibUsbScope.Oscilloscope.supports_single_channel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。