Raspberry Pi GPIO Expander Relay Drive Shield
$17.22
$27.21
I bought 5 of them. The construction is good but there are some issues: in 3 out of 5 the leds don’t work, fortunately the relays work the serigraphy on the PCB board is wrong, the connector for the other 4 lines without the relais and the GND, 5V are exchanged, be careful if you are using these connectors finally the demo code doesn’t work properly, it activates only 3 out of the 4 realis, I wrote this simple test program: #! /usr/bin/python import smbus import sys import getopt import time #bus = smbus.SMBus(0) #Rev 1 board bus = smbus.SMBus(1) # New Rev 2 board address = 0x20 # I2C address of MCP23008 bus.write_byte_data(address,0x00,0x00) # Set all to outputs # Handle the command line arguments delay = 1 try: while True: bus.write_byte_data(address,0x09,16) # time.sleep(delay) # 1 second delay bus.write_byte_data(address,0x09,32) # time.sleep(delay) bus.write_byte_data(address, 0x09, 64) time.sleep(delay) bus.write_byte_data(address, 0x09, 128) time.sleep(delay) bus.write_byte_data(address, 0x09, 0) except KeyboardInterrupt:
Rpi Shield Hat, Accessories