10
REM Quaker
20 REM Simple earth quake detector demonstration
30 REM Needs Velleman K8055 USB Experiment
Interface board
40 REM Jochen Lueg
50 REM Limavady, December 2009
60
70 MODE 15
80
90 REM Find dll routines addresses
100 PROCinit
110
120 VDU5
130 REM Turn board 0 on
140 SYS USB_OpenDevice%,0
150 CLG
160
170 MOUSE ON
180
190 COLOUR 5
200 MOVE 10,1000
210 PRINT"Press the left mouse button to start"
220 MOVE 10,960
230 PRINT "Press the right button to pause"
240 REPEAT
250 MOUSE x%,x%,b%
260 UNTIL b%=4
270 CLG
280 GCOL 5
290 REM Start at the top of the screen and repeat until you
reach the bottom - 5 traces
300
|
310 REPEAT
320 CLG
330 FOR Y%= 1800 TO 200 STEP -200
340
350 FOR X%= 0 TO
2559 STEP 2
360 SYS
A%,1 TO V%
370 PLOT 5,
X%,Y%+V%*4
380 MOUSE
x%,y%,b%
390 IF b%=1
THEN
400
REPEAT
410
MOUSE x%,y%,b%
420
UNTIL b%=4
430 ENDIF
440 NEXT
450 MOVE 0,Y%-200
460 NEXT
470 UNTIL FALSE
480 SYS USB_CloseDevice%
490
500 *QUIT
510
520 END
530
540 DEFPROCinit
550 REM Typing errors in routine name do not
generate an error message - they just hang up the program.
560 SYS"LoadLibrary","K8055D.dll" TO USB_Board%
570 SYS"GetProcAddress",USB_Board%,"OpenDevice" TO
USB_OpenDevice%
580 SYS"GetProcAddress",USB_Board%,"ReadAnalogueChannel",1
TO USB_ReadAnalogue%
590 SYS"GetProcAddress",USB_Board%,"SetAllDigital"
TO USB_SetAllDigital%
600 SYS"GetProcAddress",USB_Board%,"CloseDevice" TO
USB_CloseDevice%
610 SYS"GetProcAddress",USB_Board%,"ClearAllDigital" TO
USB_ClearAllDigital%
620 SYS"GetProcAddress",USB_Board%,"ClearDigitalChannel" TO
USB_ClearDigitalChannel%
630 SYS"GetProcAddress",USB_Board%,"SetDigitalChannel" TO
USB_SetDigitalChannel%
640 SYS"GetProcAddress",USB_Board%,"ReadAnalogChannel" TO A%
650 ENDPROC
|