'{$STAMP BS2} ' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ' ' Example program to be loaded on the D Stamp that exercises the data ' connections between the D and K stamp and the LED attached to the D-Stamp. ' Pins ' P14 - Connection to K-Stamp (P1) - defined as serial output in this example ' P15 - Connection to K-Stamp (P0) - defined as serial output in this example ' P8 - Red LED ' ' Note: After loading this code on the D-Stamp and the associated code on the K-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 d_output_data_a var byte d_output_data_b var byte ' Define I/O Pin types output 8 output 14 output 15 ' initialize state of LED low 8 ' initialize variables d_output_data_a = 0 d_output_data_b = 255 loop_top: d_output_data_a = d_output_data_a+1 ' modify data d_output_data_b = d_output_data_b-1 serout 14,$8020,[d_output_data_a] ' transmit byte a pause 250 ' wait 250ms serout 15,$8020,[d_output_data_b] ' transmit byte b debug CLS,"%%% D-Stamp %%%",CR,LF,dec ? d_output_data_a ' watch variables debug dec ? d_output_data_b toggle 8 ' toggle red LED pause 250 ' wait 250ms goto loop_top ' repeat process