forked from RodionGork/TinyBasic
-
Notifications
You must be signed in to change notification settings - Fork 6
radio rda5807
Rodion Gorkovenko edited this page Feb 17, 2018
·
2 revisions
5 dim m 8
6 data 0xC0 3 0 3
10 poke 0xbc;0
15 delay 100
20 poke 0xb8;7
25 print "Init"
29 n=4
30 gosub 200
35 delay 1000
36 print "Scan..."
37 n=4
38 m(0)=0xC1
39 m(1)=0x0D
40 gosub 200
45 delay 2000
50 print "Reading"
55 gosub 400
60 input a
70 goto 36
99 rem Write control register
100 poke 0xbc;c
110 if peek(0xbc)/128=0;goto 110
120 return
149 rem Send data byte
150 poke 0xbb;d
154 c=0x84
155 gosub 100
160 return
199 rem Send n bytes from array m
200 c=0xA4
205 gosub 100
210 d=32
215 gosub 150
220 i=0
225 d=m(i)
230 gosub 150
235 i=i+1
240 if i<n; goto 225
250 poke 0xbc;0x94
255 delay 100
260 return
399 rem read and print channel
400 c=0xA4
405 gosub 100
410 d=33
415 gosub 150
420 c=0xC4
425 gosub 100
430 x=(peek(0xbb)%128)*256
435 c=0x84
440 gosub 100
445 print (x+peek(0xbb))%1024
450 poke 0xbc;0x94
460 return