You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PiFaceDigital driver does not handle the board config parameter correct. It fails when providing a value via config file as the conversion from string to integer misses.
Proposed solution is:
... from webiopi.utils.types import toint ... class PiFaceDigital(): def init(self, board=0): self.board = toint(board) mcp = MCP23S17(0, 0x20 + self.board) mcp.writeRegister(mcp.getAddress(mcp.IODIR, 0), 0x00) # Port A as output mcp.writeRegister(mcp.getAddress(mcp.IODIR, 8), 0xFF) # Port B as input mcp.writeRegister(mcp.getAddress(mcp.GPPU, 0), 0x00) # Port A PU OFF mcp.writeRegister(mcp.getAddress(mcp.GPPU, 8), 0xFF) # Port B PU ON self.mcp = mcp
<<<<<
WebIOPi version used? => 0.7
Python version used? => 2/3
Distro used? (WebIOPi has only been tested on Raspbian Wheezy) => Raspbian Wheezy
Raspberry Pi board revision? (1 or 2) => n/a
Comment 1
Posted by andreas.riegg
Proposed solution was not correct, this one should work:
... from webiopi.utils.types import toint ...
class PiFaceDigital(): def init(self, board=0): board = toint(board) mcp = MCP23S17(0, 0x20 + board) mcp.writeRegister(mcp.getAddress(mcp.IODIR, 0), 0x00) # Port A as output mcp.writeRegister(mcp.getAddress(mcp.IODIR, 8), 0xFF) # Port B as input mcp.writeRegister(mcp.getAddress(mcp.GPPU, 0), 0x00) # Port A PU OFF mcp.writeRegister(mcp.getAddress(mcp.GPPU, 8), 0xFF) # Port B PU ON self.mcp = mcp self.board = board
The text was updated successfully, but these errors were encountered:
http://webiopi.trouch.com/issues/112/
Posted by andreas.riegg
The PiFaceDigital driver does not handle the board config parameter correct. It fails when providing a value via config file as the conversion from string to integer misses.
Proposed solution is:
... from webiopi.utils.types import toint ... class PiFaceDigital(): def init(self, board=0): self.board = toint(board) mcp = MCP23S17(0, 0x20 + self.board) mcp.writeRegister(mcp.getAddress(mcp.IODIR, 0), 0x00) # Port A as output mcp.writeRegister(mcp.getAddress(mcp.IODIR, 8), 0xFF) # Port B as input mcp.writeRegister(mcp.getAddress(mcp.GPPU, 0), 0x00) # Port A PU OFF mcp.writeRegister(mcp.getAddress(mcp.GPPU, 8), 0xFF) # Port B PU ON self.mcp = mcp
<<<<<
WebIOPi version used? => 0.7
Python version used? => 2/3
Distro used? (WebIOPi has only been tested on Raspbian Wheezy) => Raspbian Wheezy
Raspberry Pi board revision? (1 or 2) => n/a
Comment 1
Posted by andreas.riegg
Proposed solution was not correct, this one should work:
... from webiopi.utils.types import toint ...
class PiFaceDigital(): def init(self, board=0): board = toint(board) mcp = MCP23S17(0, 0x20 + board) mcp.writeRegister(mcp.getAddress(mcp.IODIR, 0), 0x00) # Port A as output mcp.writeRegister(mcp.getAddress(mcp.IODIR, 8), 0xFF) # Port B as input mcp.writeRegister(mcp.getAddress(mcp.GPPU, 0), 0x00) # Port A PU OFF mcp.writeRegister(mcp.getAddress(mcp.GPPU, 8), 0xFF) # Port B PU ON self.mcp = mcp self.board = board
The text was updated successfully, but these errors were encountered: