Skip to content

Instantly share code, notes, and snippets.

@thisMagpie
Last active November 20, 2015 16:36
Show Gist options
  • Save thisMagpie/4d59ea99a4641d0e2e8a to your computer and use it in GitHub Desktop.
Save thisMagpie/4d59ea99a4641d0e2e8a to your computer and use it in GitHub Desktop.
from webiopi.devices.analog import MCP3208, MCP4922
ADC0 = MCP3208(chip = 0)
DAC1 = MCP4922(chip = 1)
print "Setting output to 1.3 on channel 0 of DAC1"
DAC1.analogWriteVolt(0, 1.3) # set volatage of output channel VoutA to 1.3V
print("Analog Read DAC1 Voltage of channel 0", DAC1.analogReadVolt(0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment