Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 从MCP3008获得固定采样率的方法?_Python_Logging_Raspberry Pi_Iot - Fatal编程技术网

Python 从MCP3008获得固定采样率的方法?

Python 从MCP3008获得固定采样率的方法?,python,logging,raspberry-pi,iot,Python,Logging,Raspberry Pi,Iot,我使用raspberry pi 4通过python脚本收集传感器数据,并使用Mcp3008将其写入日志文件。代码如下: While i<1000: val=mcp.read_adc(0) logging.info('Signal={0:0.3f}'.format(item)) i+=1 当我

我使用raspberry pi 4通过python脚本收集传感器数据,并使用Mcp3008将其写入日志文件。代码如下:

While i<1000:
  val=mcp.read_adc(0)
  logging.info('Signal={0:0.3f}'.format(item))
  i+=1
当我