'---------------------------------------------------------------------------------------- ' Name: INTM4_COUNTS.TIG ' Type: TIGER-BASIC(tm) Source Code ' Purpose: DEMO - demonstrates the INTM4 Counts ' ' ' (C) - Copyright Wilke Technology, P.O.Box 1727, D-52018 Aachen, Germany '---------------------------------------------------------------------------------------- ' ' Thank you for using BASIC Tigers in your products. If you have questions, ideas ' or special needs, please contact your next distributor or the Tiger support team ' and visit our web site: ' ' Wilke Technology GmbH ' The Tiger Support Team ' P.O.Box 1727, D-52018 Aachen, Germany ' Krefelder Str. 147, D-52070 Aachen, Germany ' ' email: support@wilke-technology.com (english) ' email: support@wilke.de (german) ' Phone: +49 (241) 918 900 Mo to Fr, 7:00 to 16:00 (GMT) ' Fax: +49 (241) 918 9068 ' ' New information, new drivers and free downloads see: ' ' www.wilke-technology.com (english) ' www.wilke.de (german) ' ' Sincerely, ' ' Your Tiger Support Team ' '---------------------------------------------------------------------------------------- ' ' required Hardware: Tiger 2 ' LCD 320*240 (EPSON S1D13700 Controller) ' ' ' ==> To increase the Counts, please give pulses to INTM4 ' ' '---------------------------------------------------------------------------------------- ' ' ERG = counts() ' ! ' !------------------------ reads out the current Counter of INTM4 Pin Interrupt (LONG) ' ' ' set_counts( X ) ' ! ' !------- sets the INTM4 Counter to this value (LONG) ' ' ' ' ERG = diff_counts( X ) ' ! ! ' ! !------ this function calculates the difference between the INTM4 Counter and this value (LONG) ' !------------------------ result of the difference between The INTM4 Counter and X (LONG) ' '---------------------------------------------------------------------------------------- user_var_strict task main long INTM4_Counts, x, INTM4_Diff_Counts, INTM4_temp '----------------------------------------------------------------------------------------------------- ' Reset the LCD '----------------------------------------------------------------------------------------------------- dir_pin 8,5,0 ' Tiny Tiger 2 Prtotyping Board: This is the RESET of the LCD OUT 8, 255, 0 ' Reset the LCD OUT 8, 255, 255 ' Be sure there is no reset more wait_duration 1000 ' wait that the LCD is not busy '----------------------------------------------------------------------------------------------------- ' Install the Device '----------------------------------------------------------------------------------------------------- install_device #1, "LCD-S1D13700.TD2",0,0,0EEH,1,250, 02H set_counts(0) ' set counter to 0 while 1 = 1 INTM4_temp = counts() FOR x=0 TO 50 STEP 1 ' LOOP INTM4_Counts = counts() ' read counter print #1, "<1BH>A"; CHR$(0); CHR$(0); "<0F0H>"; "INTM4 Counts : " ; INTM4_Counts wait_duration 100 ' wait 100ms next INTM4_Diff_Counts = diff_counts(INTM4_temp) ' read difference print #1, "<1BH>A"; CHR$(0); CHR$(1); "<0F0H>"; "INTM4 Diff (5sek) : " ; " " ' clear print #1, "<1BH>A"; CHR$(0); CHR$(1); "<0F0H>"; "INTM4 Diff (5sek) : " ; INTM4_Diff_Counts ' print endwhile end