Posted by max.benedetti74
What steps will reproduce the problem? 1.Can I have some code examples to use the DS2408 please ?
I've try with:
from webiopi.utils import * from webiopi.devices.onewire import * from webiopi.devices.digital import GPIOPort from webiopi.devices.digital import DS2408
sw0 = DS2408()
sw0.setFunction(0, GPIO.OUT) sw0.setFunction(1, GPIO.OUT) sw0.setFunction(2, GPIO.OUT) sw0.setFunction(3, GPIO.OUT) sw0.setFunction(4, GPIO.OUT) sw0.setFunction(7, GPIO.OUT)
sw0.digitalWrite(0, GPIO.HIGH) time.sleep(5) #wait 5 seconds sw0.digitalWrite(0, GPIO.LOW)
But not work is correct the code ?
WebIOPi version used? =>0.6.0
Python version used? =>Python 2.7.3
Distro used? (WebIOPi has only been tested on Raspbian Wheezy) =>Raspbian Wheezy
Raspberry Pi board revision? (1 or 2) =>
For Javascript side bugs, Browser? =>
Please provide any additional information below.
Posted by max.benedetti74
Now I try agan and working but I try to read all inputs with sw0.digitalReadAll() and give an error below.
Traceback (most recent call last):
File "ds24.py", line 29, in
Posted by trouch
Function missing
you can use portRead instead
Posted by trouch
Posted by trouch
Posted by trouch
Posted by trouch
Delayed for major release
Posted by andreas.riegg
Maybe you can retry your code with the updated 2408 driver from issue 95. For correct operation, please look at the driver comments and the setting of the RSTZ pin as this influences correct working of output ports.
Andreas