symbol IO_0 = %01000000 '#0 Microchip MCP23017 I/O expander i2c address
symbol IO_1 = %01000010 '#1 Microchip MCP23017 I/O expander i2c address
symbol IO_2 = %01000100 '#2 Microchip MCP23017 I/O expander i2c address
symbol IO_3 = %01000110 '#3 Microchip MCP23017 I/O expander i2c address
'MCP23017 on 28X1 @ 16Mhz using Hardware i2c Replace hi2csetup master with i2cslave on non X1 PICAXE
hi2csetup i2cmaster,IO_0,i2cslow_16,i2cbyte
'[IO_0] %0100 0 0 0 0 is the address with A0,A1,A2 all tied to 0V
hi2cout [IO_0],0,($00,$00) 'IODIRA,IODIRB set port direction register to output
hi2cout 8,($00,$00) 'IOCON0 Active driver output, Active Low - i.e sinks.
hi2cout $12,(%11111111,%11111111) 'turn off all the LEDs (output High)
hi2cout [IO_1],0,($00,$00) 'IODIRA,IODIRB set port direction register to output
hi2cout 8,($00,$00) 'IOCON0 Active driver output, Active Low - i.e sinks.
hi2cout $12,(%11111111,%11111111) 'turn off all the LEDs (output High)
hi2cout [IO_2],0,($00,$00) 'IODIRA,IODIRB set port direction register to output
hi2cout 8,($00,$00) 'IOCON0 Active driver output, Active Low - i.e sinks.
hi2cout $12,(%11111111,%11111111) 'turn off all the LEDs (output High)
hi2cout [IO_3],0,($00,$00) 'IODIRA,IODIRB set port direction register to output
hi2cout 8,($00,$00) 'IOCON0 Active driver output, Active Low - i.e sinks.
hi2cout $12,(%11111111,%11111111) 'turn off all the LEDs (output High)