DECLARE SUB sdelay (duration%) ' * LED1190.C ' * ' * Demo program for Micro/sys SBC1190 ' * Single Board Computer. ' * ' * This program blinks the red LED on the SBC1190. The cycle ' * consists of 2 seconds with the LED on and 2 seconds with ' * the LED off. ' * ' * 8/4/98 ' * CONST P1DIR = &HFF50 CONST P1PIN = &HFF52 CONST P1CON = &HFF54 CONST P1LTCH = &HFF56 CONST REDLED = &H40 ' port pin P1.6 'The following line allows output to be redirected out the COM1 port if 'there is no video card installed. Otherwise, QuickBASIC uses direct 'writes to video RAM. OPEN "CONS:" FOR OUTPUT AS #1 OUT P1CON, INP(P1CON) AND (NOT REDLED) ' setup pin as I/O OUT P1DIR, INP(P1DIR) AND (NOT REDLED) ' setup pin for output forever: PRINT #1, "SBC1190 LED Test" OUT P1LTCH, INP(P1LTCH) AND (NOT REDLED) ' turn on LED sdelay 2 OUT P1LTCH, INP(P1LTCH) OR REDLED ' turn off LED sdelay 2 GOTO forever SUB sdelay (duration%) ' Pauses for a specified number of tenths of seconds. Start! = TIMER WHILE (TIMER < (Start! + duration%)) WEND END SUB