This file contains hidden or 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 webiopi.devices.analog import MCP3208 | |
import pylab | |
import numpy as np | |
import datetime | |
ADC0 = MCP3208(chip = 0) | |
time = datetime.datetime.now().microsecond | |
print("Time: {0}").format(time) | |
print("Analog Channel Count {0}").format(ADC0.analogCount()) |
This file contains hidden or 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 webiopi.devices.analog import MCP3208 | |
import pylab | |
import numpy as np | |
from datetime import * | |
time = datetime.now().microsecond | |
print(time) | |
ADC0 = MCP3208(chip = 0) |
This file contains hidden or 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 webiopi.devices.analog import MCP3208 | |
import pylab | |
import numpy as np | |
x = [0.0]*100 | |
y = [0.0]*100 | |
hi_arr = [0.0] | |
low_arr = [0.0] |
This file contains hidden or 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 webiopi.devices.analog import MCP3208 | |
import pylab | |
import numpy as np | |
ADC0 = MCP3208(chip = 0) | |
print("Analog Channel Count {0}").format(ADC0.analogCount()) | |
print("Analog Bit Resolution {0}").format(ADC0.analogResolution()) | |
print("Analog Maximum {0}").format(ADC0.analogMaximum()) | |
print("Analog Reference Voltage {0}").format(ADC0.analogReference()) |
This file contains hidden or 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 webiopi.devices.analog import MCP3208 | |
import pylab | |
import numpy as np | |
ADC0 = MCP3208(chip = 0) | |
print("Analog Channel Count {0}").format(ADC0.analogCount()) | |
print("Analog Bit Resolution {0}").format(ADC0.analogResolution()) | |
print("Analog Maximum {0}").format(ADC0.analogMaximum()) | |
print("Analog Reference Voltage {0}").format(ADC0.analogReference()) |
This file contains hidden or 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
('Analog Count ', 8) | |
('Analog Resolution ', 12) | |
('Analog Maximum ', 4095) | |
('Analog Reference ', 3.3) | |
('Analog Read Channel ', 0, 0) | |
('Analog Read Voltage ', 0, 0.0) | |
('Analog Read Channel ', 1, 0) | |
('Analog Read Voltage ', 1, 0.0) | |
This file contains hidden or 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
import webiopi | |
GPIO = webiopi.GPIO # Assign GPIO object | |
LED0 = 24 # Set GPIO Pin to 24 | |
GPIO.setFunction(LED0, GPIO.OUT) # Set GPIO LED0 Pin 24 to OUT | |
""" | |
Function to toggle logic | |
""" | |
def toggleLED0(): |
This file contains hidden or 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
import webiopi | |
GPIO = webiopi.GPIO # Assign GPIO object | |
LED0 = 24 # Set GPIO Pin to 24 | |
GPIO.setFunction(LED0, GPIO.OUT) # Set GPIO Pin to OUT | |
GPIO.digitalWrite(LED0, GPIO.HIGH) # Turn on LED | |
webiopi.sleep(2) # Wait 2 seconds |
This file contains hidden or 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
import webiopi | |
from webiopi.devices.analog import MCP3208, MCP4922 | |
ADC0 = MCP3208(chip = 0) | |
DAC1 = MCP4922(chip = 1) | |
print("Number of DAC1 Outputs: {0} ").format(DAC1.analogCount()) | |
vout = 1.0 | |
vref = DAC1.analogReference() |
This file contains hidden or 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 webiopi.devices.analog import MCP3208 | |
ADC0 = MCP3208(chip = 0) | |
print ADC0.analogReadAllVolt() | |
print("Analog Count ", ADC0.analogCount()) | |
print("Analog Resolution ", ADC0.analogResolution()) | |
print("Analog Maximum ", ADC0.analogMaximum()) | |
print("Analog Reference ", ADC0.analogReference()) |