'---------------------------------------------------------------------------------------- ' Name: PIN_XPIN_DEMO_00x.TIG ' Type: TIGER-BASIC Source Code ' Purpose: This is an example program used for demonstration of new functions: ' ' VAR = PIN (internal_Port, Bit) ' and: VAR = XPIN (XPort, Bit) ' ' (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 ' '---------------------------------------------------------------------------------------- ' ' This short example program was compiled with TIGER-BASIC 5.01 to run with a AXI-4/4 ' BASIC Tiger Module on the Plug & Play Lab. ' ' The new functions: "PIN" and "XPIN" are testing an input pin and blinking LEDs ' accordingly. ' ' Port 7, Bit-0 ---> Input pin for blinking LEDs 80...83 ' XPort 80h, Bit-4 ---> Input pin for blinking LEDs 84...87 ' '---------------------------------------------------------------------------------------- USER_VAR_STRICT ' Variables must be declared TASK MAIN ' Begin task MAIN LONG EVER, N ' Variables for loop, counting DIR_PIN 7, 0, 1 ' Port 7, Pin/Bit 0 = Input DIR_PIN 7, 1, 1 ' Port 7, Pin/Bit 1 = Input DIR_PORT 8, 0 ' Port 8 is output RUN_TASK XPORT ' Start XPort reading FOR EVER = 0 TO 0 STEP 0 ' <----- Endless loop --------------------------- WHILE 1 = PIN (7, 0) ' Read port 7, bit 0 <=== new function "PIN" N = N + 1 ' Increase counter WAIT_DURATION 60 ' Wait 60 ms OUT 8, 00Fh, N ' Output counter to lower 4 bit of port 8 ENDWHILE ' WAIT_DURATION 2 ' Just release NEXT ' ------ End of endless loop -------------------> END ' End of task MAIN TASK XPORT ' Begin task XPORT LONG EVER,N ' Variables for loop, counting FOR EVER = 0 TO 0 STEP 0 ' <----- Endless loop --------------------------- WHILE 0 = XPIN (80H, 4) ' Read XPort 80h, bit 4 <=== new function "XPIN" N = N + 10h ' Increase counter WAIT_DURATION 60 ' Wait 60 ms OUT 8, 0F0H, N ' Output counter to upper 4 bit of port 8 ENDWHILE ' WAIT_DURATION 2 ' Just release NEXT ' ------ End of endless loop -------------------> END ' End of task XPORT