import time
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.MCP230xx as MCP
# P9.17 = I2C1_SCL
# P9.18 = I2C1_SDA
# Alternatively you can initialize the MCP device on another I2C address or $
mcp = MCP.MCP23017(0x27, busnum=2)
mcp.setup(8, GPIO.OUT)
mcp.output(8, GPIO.HIGH)
time.sleep(0.5)
mcp.output(8, GPIO.LOW)
time.sleep(0.5)
mcp.output(8, GPIO.HIGH)
mcp.setup(9, GPIO.IN)
mcp.pullup(9, True)
print (mcp.input(9))
mcp.setup(15, GPIO.OUT)
for j in range(1000000): # a loop counter
mcp.output(15, GPIO.HIGH)
time.sleep(1)
mcp.output(15, GPIO.LOW)
time.sleep(1)
import time
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.MCP230xx as MCP
# P9.17 = I2C1_SCL
# P9.18 = I2C1_SDA
# Alternatively you can initialize the MCP device on another I2C address or $
mcp = MCP.MCP23017(0x27, busnum=2)
for x in range(0, 15):
mcp.setup(x, GPIO.OUT)
mcp.output(x, GPIO.HIGH)
time.sleep(.1)
mcp.output(x, GPIO.LOW)
time.sleep(.1)
denys wrote:This makes the port pins go low, but not high again.
But I do not see all the port pins running. As I am in the house and watching the board via video in my workshop, it is a bit hard to see what pins are running.
I may get more time tomorrow but it is almost midnight so I'm off to bed.
- Code: Select all | TOGGLE FULL SIZE
for x in range(0, 15):
mcp.setup(x, GPIO.OUT)
mcp.output(x, GPIO.HIGH)
time.sleep(.1)
mcp.output(x, GPIO.LOW)
time.sleep(.1)
import time
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.MCP230xx as MCP
# P9.17 = I2C1_SCL
# P9.18 = I2C1_SDA
# Alternatively you can initialize the MCP device on another I2C address or $
mcp = MCP.MCP23017(0x27, busnum=1)
for x in range(0, 15):
print(x)
mcp.setup(x, GPIO.OUT)
mcp.output(x, GPIO.LOW)
time.sleep(.5)
mcp.output(x, GPIO.HIGH)
time.sleep(.5)
denys wrote:Hi Drew.
Still, this is just a small part of the whole application. And I am getting tired of this battle. Can you explain to me why my original code that was working well now does not? All I want is it to work again.