Created
August 11, 2017 22:18
-
-
Save tannewt/94271e9a7941167714ffb20ec72fa22f to your computer and use it in GitHub Desktop.
analog read/write test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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