'{$STAMP BS2} ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' ' Example program to be loaded on the K Stamp that exercises the data ' connections between the D and K stamp and the LEDs attached to the K-Stamp. ' Pins ' P0 - Connection to D-Stamp (P15) - defined as serial input in this example ' P1 - Connection to D-Stamp (P14) - defined as serial input in this example ' P7 - Green LED ' P8 - Yellow LED ' ' Note: After loading this code on the K-Stamp and the associated code on the D-stamp, open the ' debug console and flip the D-Stamp/K-Stamp toggle switches on the the serial port switch box. ' You should see the transmitted data from the D-stamp matching the received data on the K-stamp. ' ' Bryce Himebaugh ' 2/4/04 ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' Constant Definition LF con 10 ' Define Variables k_input_data_a var byte k_input_data_b var byte ' Define I/O Pin types input 0 input 1 output 7 output 8 ' initialize state of LEDS low 7 high 8 ' initialize variables k_input_data_a = 0 k_input_data_b = 0 loop_top: serin 1,$20,[k_input_data_a] ' receive byte a serin 0,$20,[k_input_data_b] ' receive byte b debug CLS,"%%% K-Stamp %%%",CR,LF,dec ? k_input_data_a ' watch variables debug dec ? k_input_data_b toggle 7 ' toggle green LED toggle 8 ' toggle yellow LED goto loop_top ' repeat