from gpiozero import MCP3008 import time import math adc = MCP3008(channel=0) count = 0 # 5K resistor volts = {1.87: 0.0, 2.04: 22.5, 0.79: 45.0, 0.80: 45.0, 0.88: 67.5, 0.13: 90.0, 0.36: 112.5, 0.24: 135.0, 0.62: 157.5, 0.44: 180.0, 1.44: 202.5, 1.27: 225.0, 2.81: 247.5, 2.76: 270.0, 2.91: 292.5, 2.31: 315.0, 2.59: 337.5} while True: wind = round(adc.value*3.3,2) print(wind) time.sleep(1)