Parallax, Inc. • BS2p “Plus Pack” (#45184) • 10/2001
Page 20
PAUSE 100
DEBUG "PCF8574 Demo", CR
DEBUG "Press button to update counter"
' -----[ Main Code ]------------------------------------------------------------
'
Main:
I2CIN I2Cpin, Rd8574, (MixDDR | ~cntr), [ioByte]
IF (btn) THEN Main ' w ait for press
cntr = cntr + 1 // 4 ' update counter
DEBUG Home, 10, 10, 10, BIN2 cntr ' display on screen
I2COUT I2Cpin, Wr8574, MixDDR, [~cntr] ' send new value
PAUSE 200
GOTO Main
' -----[ Subroutines ]----------------------------------------------------------
'