Skip to content

Instantly share code, notes, and snippets.

@tannewt
Created August 11, 2017 22:18
Show Gist options
  • Save tannewt/94271e9a7941167714ffb20ec72fa22f to your computer and use it in GitHub Desktop.
Save tannewt/94271e9a7941167714ffb20ec72fa22f to your computer and use it in GitHub Desktop.
analog read/write test
from board import *
from analogio import *
aout = AnalogOut(A0)
d0in = AnalogIn(D0)
def getVoltage(pin):
return (pin.value * 3.3) / 65536
aout.value = 65536 // 3
print("aout", 65536 // 3)
ain = (d0in.value * 3.3 / 65536)
print("d0in", d0in.value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment