'{$STAMP BS2} ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' ' Example program that demonstrates a simple broadcast on the communication link between the ' stamps at different workstations. This code will be loaded on a K-Stamp at one workstation. One ' or more other K-Stamps will be loaded with the K_LISTEN.bs2 code. ' ' The data link is composed of a single wire connection between P15 of the K-Stamps in workstations ' LH03512-LH03517. There is one pull-up for the common node located in LH03512. The common node ' forms a "wired AND" junction. You will need to use the serout command in the open-collector mode. ' Open-collector means that the output driver can pull the line to 0, but it cannot drive it to 1. ' The external pull-up takes care of pulling the pin to 1. ' ' P15 - Open Collector Network Connection. ' ' Bryce Himebaugh ' 2/5/04 ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' Constant Definition LF con 10 ' Define Variables data_out var byte ' Define I/O Pin types output 15 ' initialize variables data_out = 255 loop_top: pause 500 data_out = data_out + 1 serout 15,$8054,[data_out] ' 9600 baud, open collector, no par, no invert, 8 bits debug CLS,"%%% K-Stamp Transmitted Data %%%",CR,LF,dec ? data_out goto loop_top