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.sensor import DS18S20 | |
import datetime | |
import pylab | |
import math | |
# sensors found with "ls /sys/bus/w1/devices/" | |
tmp0 = DS18S20(slave="10-000802de0ee7") | |
tmp1 = DS18S20(slave="10-000802de4b20") | |
N = 50 |
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.sensor import DS18S20 | |
import datetime | |
import pylab | |
import math | |
# sensors found with "ls /sys/bus/w1/devices/" | |
tmp0 = DS18S20(slave="10-000802de0ee7") | |
tmp1 = DS18S20(slave="10-000802de4b20") | |
N = 50 |
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.sensor import DS18S20 | |
import datetime | |
# sensors found with "ls /sys/bus/w1/devices/" | |
tmp0 = DS18S20(slave="10-000802de0ee7") | |
tmp1 = DS18S20(slave="10-000802de4b20") | |
while True: | |
print("{0} TEMP0: {1}C TEMP1: {2}C").format(datetime.datetime.now(), | |
tmp0.getCelsius(), |
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.sensor import DS18S20 | |
# sensors found with "ls /sys/bus/w1/devices/" | |
tmp0 = DS18S20(slave="10-000802de0ee7") | |
tmp1 = DS18S20(slave="10-000802de4b20") | |
print("TEMP0: {0} C TEMP1: {1} C").format(tmp0.getCelsius(), tmp1.getCelsius()) # print temperature |
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.sensor import DS18S20 | |
import datetime | |
import pylab | |
tmp0 = DS18S20(slave="10-000802de0ee7") # sensor found with "ls /sys/bus/w1/devices/" | |
time = [datetime.datetime.now()] | |
temp = [tmp0.getCelsius()] | |
pylab.ion() |
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.sensor import DS18S20 | |
import datetime | |
import pylab | |
tmp0 = DS18S20(slave="10-000802de0ee7") # sensor found with "ls /sys/bus/w1/devices/" | |
N = 50 | |
x = [0.0]*N | |
y = [0.0]*N |
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.sensor import DS18S20 | |
tmp0 = DS18S20(slave="10-000802de0ee7") # sensor found with "ls /sys/bus/w1/devices/" | |
print("TEMP: {0} C ").format(tmp0.getCelsius()) # print temperature |
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.digital import PCF8574A | |
mcp = PCF8574A(slave=0x38) # 0111000 | |
GPIO = webiopi.GPIO # Assign webiopi library to GPIO object | |
leds = 4 # number of led outputs in total | |
SWITCH0 = 4 # Set Switch value to P4 | |
for index in range(leds): |
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.digital import PCF8574A | |
mcp = PCF8574A(slave=0x38) # 0111000 | |
GPIO = webiopi.GPIO # Assign webiopi library to GPIO object | |
leds = 4 # number of led outputs in total (negative logic) | |
for index in range(leds): | |
mcp.setFunction(index, GPIO.OUT) #Set pin at index as output |
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.digital import PCF8574A | |
mcp = PCF8574A(slave=0x38) | |
GPIO = webiopi.GPIO # Assign webiopi library to GPIO object | |
LED0 = 0 # Set PCF8574 GPIO pin 0 to connect to the LED (negative logic) | |
mcp.setFunction(LED0, GPIO.OUT) #Set Pin 0 as output | |
mcp.digitalWrite(LED0, GPIO.LOW) # Turn on the LED for the first time |
NewerOlder