1
라즈베리 PI를 사용하여 AD8232 심장 모니터를 프로그래밍하려고합니다. ump 및 ADC ads1115에 설치된 모든 올바른 패키지를 만들 수 있습니다. 내가 겪고있는 문제는 내가 값 오류를 얻으려고 할 때이다. 파일 "/usr/lib/python2.7/dist-packages/upm/pyupm_ad8232.py", 170 행, 초기화 this = _pyupm_ad8232.new_AD8232 (loPlus, loMinus, output, aref) ValueError : UPM 잘못된 인수 : 잘못된 AIO 핀이 지정되었습니다. ADC가 있습니까? 아무도이 문제에 도움이 될 수 있습니다, 사용중인 python 스크립트는 아래에 있습니다 감사합니다.라즈베리 PI AD8232
#!/usr/bin/env python3
from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_ad8232 as upmAD8232
from upm import pyupm_ads1x15 as upm
def main():
# Instantiate a AD8232 sensor on digital pins 10 (LO+), 11 (LO-)
# and an analog pin, 0 (OUTPUT)
myAD8232 = upmAD8232.AD8232(10, 11, 8)
## Exit handlers ##
# This function stops python from printing a stacktrace when you hit
def SIGINTHandler(signum, frame):
raise SystemExit
# This function lets you run code on exit, including functions from myAD8232
def exitHandler():
print("Exiting")
sys.exit(0)
# Register exit handlers
atexit.register(exitHandler)
signal.signal(signal.SIGINT, SIGINTHandler)
# Output the raw numbers from the ADC, for plotting elsewhere.
# A return of 0 indicates a Lead Off (LO) condition.
# In theory, this data could be fed to software like Processing
# (https://www.processing.org/) to plot the data just like an
# EKG you would see in a hospital.
while(1):
print(myAD8232.value())
time.sleep(.001)
if __name__ == '__main__':
main()