; Keith Neufeld ; 26-Feb-2006 ; ; LogoChip program to demo triggering external audio playback modules. ; Using Radio Shack 276-1323 20-second recording modules ; with play buttons wired to LogoChip ports C6 and C7. ; Play buttons are active low. constants [ [squawk-port portc] [squawk-ddr portc-ddr] [squawk-left-bit 6] [squawk-right-bit 7] ] ; Configure the I/O port at powerup and startup to powerup init-squawk-port end to startup init-squawk-port end ; Configure the I/O port to init-squawk-port ; Set left and right triggers off (active low, so set high) setbit squawk-left-bit squawk-port setbit squawk-right-bit squawk-port ; Set left and right triggers as outputs clearbit squawk-left-bit squawk-ddr clearbit squawk-right-bit squawk-ddr end ; Trigger the external playback modules ; Parameter: which module to trigger to squawk :squawk-bit ; Trigger it (active low, so set low) clearbit :squawk-bit squawk-port ; Wait a smidge to be sure it registers wait 1 ; Clear the trigger (active low, so set high) setbit :squawk-bit squawk-port end