19 #INCLUDE ONCE "BBB/pruio.bi"
21 CONST tSamp = 123401 _
31 IF .Errr
THEN ?"NEW failed: " & *.Errr :
EXIT DO
33 IF .Adc->setStep( 9, 0, 0, 0, 0)
THEN _
34 ?"step 9 configuration failed: " & *.Errr :
EXIT DO
35 IF .Adc->setStep(10, 1, 0, 0, 0)
THEN _
36 ?"step 10 configuration failed: " & *.Errr :
EXIT DO
37 IF .Adc->setStep(11, 2, 0, 0, 0)
THEN _
38 ?"step 11 configuration failed: " & *.Errr :
EXIT DO
40 VAR mask = &b111
SHL 9 _
48 ?"config failed: " & *.Errr :
EXIT DO
51 ?"rb_start failed: " & *.Errr :
EXIT DO
53 VAR p0 = .Adc->Value _
55 FOR n AS INTEGER = 0
TO NoFile - 1
58 IF OPEN(
fnam FOR OUTPUT AS fnr)
THEN
59 ?"Cannot open " &
fnam
61 ?"Creating file " &
fnam
68 WHILE .DRam[0] <
iEnd :
SLEEP 1 :
WEND
71 SWAP p0,
p1 :
EXIT WHILE
74 IF p1 >
p0 THEN WHILE .DRam[0] <
half :
SLEEP 1 :
WEND _
75 ELSE WHILE .DRam[0] >
half :
SLEEP 1 :
WEND
76 ?" writing samples " & (
i -
half) &
"-" & (
i - 1)
80 ?"Finished file " &
fnam