Parallax, Inc. • BS2p “Plus Pack” (#45184) • 10/2001
Page 18
PP_PCF8574.BSP
•
Assemble PCF8583574 circuit on breadboard
-- use on-board 4.7K resistors (R1 and R2) for pull-ups
' -----[ Title ]----------------------------------------------------------------
'
' BS2p Plus Pack
'
' File...... PP_PCF8574.BSP
' Purpose... Reads remote input and updates 2 remote outputs on PCF8574
' Author.... Parallax
' E-mail.... [email protected]
' Started...
' Updated... 26 SEP 2001
' {$STAMP BS2p}
' -----[ Program Description ]--------------------------------------------------
'
' This program reads bit 7 from the PCF8574. If that bit is high (button is
' pressed), a counter is incremented and displayed via LEDs on PCF8574 bits
' 0 and 1.
'
' Note: Most (not all) I2C devices have multiple internal addresses, so the
' I2CIN and I2COUT commands support this with an address parameter (this byte
' comes after the Slave Address byte). With the PCF8574, replace the address
' byte with a value that reflects the desired state of the I/O pins, where