OtherPapers.com - Other Term Papers and Free Essays
Search

Circuit Ideas - Electronics for You

Essay by   •  July 31, 2011  •  Study Guide  •  561 Words (3 Pages)  •  1,790 Views

Essay Preview: Circuit Ideas - Electronics for You

Report this essay
Page 1 of 3

CIRCUIT IDEAS

ELECTRONICS FOR YOUJANUARY 2003

S.C. DWIVEDI

COMPUTERISED UNIVERSAL TIMER

D.K. KAUSHIK

CLS : SCREEN 1: COLOR 3, 10

N1 = 0: N2 = 0: N3 = 0

LOCATE 4, 10: PRINT " PROGRAM DEVELOPED BY DR.D.K.KAUSHIK"

LINE (90, 60)-(200, 60), 2: LINE -(200, 75), 2

LINE -(90, 75), 2: LINE -(90, 60), 2

LOCATE 9, 14: PRINT N3; ":"; N2; ":"; N1

LOCATE 13, 9: PRINT "PRESS F1 KEY FOR TIME ADJUSTMENT"

LOCATE 15, 9: PRINT "PRESS F2 KEY FOR START"

LOCATE 17, 9: PRINT "PRESS F3 KEY TO STOP"

KEY(2) ON: ON KEY(2) GOSUB START

KEY(3) ON: ON KEY(3) GOSUB LAST1

PORT% = &H378

DELAY:

KEY(1) ON: ON KEY(1) GOSUB SET

GOTO DELAY

SET:

SOUND 650, 3

N1 = N1 + 10

IF N1 < 60 THEN LOCATE 9, 14: PRINT N3; ":"; N2; ":"; N1: RETURN

N1 = 0

N2 = N2 + 1

IF N2 < 60 THEN LOCATE 9, 14: PRINT N3; ":"; N2; ":"; N1: RETURN

N2 = 0: N3 = N3 + 1

LOCATE 9, 14: PRINT N3; ":"; N2; ":"; N1

RETURN

START:

KEY(1) OFF: KEY(2) OFF

Z1 = VAL(RIGHT$(TIME$, 2))

OUT PORT%, 1

REM FOR DEBATE COMPETITION OUT PORT%,1 SHOULD BE REPLACED

REM BY OUT PORT%,0

COMPUTER PROGRAM IN Q-BASIC

START1:

Z2 = VAL(RIGHT$(TIME$, 2))

IF Z2 = Z1 THEN GOTO START1 ELSE GOTO START2

START2:

IF N1 = 0 AND N2 = 0 AND N3 = 0 THEN LOCATE 9, 14

PRINT N3; ":"; N2; ":"; N1: GOTO LAST

N1 = N1 - 1

IF N1 < 0 THEN N1 = 59: N2 = N2 - 1

IF N2 < 0 THEN N2 = 59: N3 = N3 - 1

IF N3 < 0 THEN N3 = 0

LOCATE 9, 14: PRINT N3; ":"; N2; ":"; N1

Z1 = Z1 + 1

IF Z1 = 60 THEN Z1 = 0

IF N1 = 0 AND N2 = 0 AND N3 = 0 THEN GOTO LAST ELSE GOTO START1

LAST:

OUT PORT%, 0

REM FOR DEBATE

...

...

Download as:   txt (3.4 Kb)   pdf (71.9 Kb)   docx (10.5 Kb)  
Continue for 2 more pages »
Only available on OtherPapers.com