Home » Recent acquisitions » Acorn tapes » tape045b_acorn_acorn_user_1985_04_electron.wav » BEVLEY

BEVLEY

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn tapes » tape045b_acorn_acorn_user_1985_04_electron.wav
Filename: BEVLEY
Read OK:
File size: 0622 bytes
Load address: FFFF1900
Exec address: FFFF1900
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10REM Auto resistance measurement
   15REM By Paul Beverley
   20REM For BBC and Electron-Plus1
   25REM (c) Acorn User April 1985
   30:
   40MODE 7
   50PROCinitialise
   60REPEAT
   70PROCread_Rs
   80Rx=(65520/FNADC1-1)*Rs+.0005
   90PROCcalc_range
  100PROCprint_prompts
  110PROCdisplay_result
  120PROCchange_timing
  130UNTIL 0
  140END
  150:
  160DEF PROCinitialise
  170ON ERROR MODE 7:PROCerror:END
  180min%=400
  190ave%=2
  200places%=6
  210blank$=STRING$(18," ")
  220*FX16,4
  230VDU23,1,0;0;0;0;
  240*FX225,128
  250ENDPROC
  260:
  270DEF PROCread_Rs
  280Rs=1022.56
  290REPEAT UNTIL ADVAL0DIV256=4
  300IF ADVAL(4)<min% Rs=110.98
  310IF ADVAL(3)<min% Rs=11.0065
  320IF ADVAL(2)<min% Rs=1.0113
  330IF ADVAL(1)<min% Rs=1022.6
  340switch%=3-INT(LOG(Rs)/LOG(10))
  350ENDPROC
  360:
  370DEF FNADC1
  380*FX16,1
  390total%=0
  400FOR K%=1TOave%*50
  410IF ave%>4 IF K%MOD50=0 PRINT TAB(0,23);ave%-K%DIV50;"  ";
  420REPEAT UNTILADVAL0DIV256
  430total%=total%+ADVAL1
  440NEXT
  450*FX16,4
  460=total%/ave%/50
  470:
  480DEF PROCcalc_range
  490range%=4-LOG(Rx)/LOG(5)
  500IF range%>3 range%=3
  510ENDPROC
  520:
  530DEF PROCprint_prompts
  540D$=blank$
  550IF range%>0 D$="CLOSE SWITCH  "+STR$(range%)
  560PROCdprint (0,0,D$)
  570D$=blank$
  580IF switch%>0 D$="SWITCH  "+STR$(switch%)+"  CLOSED"
  590PROCdprint (19,0,D$)
  600ENDPROC
  610:
  620DEF PROCdisplay_result
  630IF ave%>4 VDU7
  640R$=LEFT$(STR$(Rx),places%)+" k ohms   "
  650IF Rx>1000 R$=LEFT$(STR$(Rx/1000),places%)+" M ohms   "
  660IF Rx<1 R$=LEFT$(STR$(Rx*1000),places%)+" ohms   "
  670PROCdprint(12,10,R$)
  680ENDPROC
  690:
  700DEF PROCdprint(X%,Y%,Z$)
  710PRINT TAB(X%,Y%) CHR$(141);Z$
  720PRINT TAB(X%,Y%+1) CHR$(141);Z$
  730ENDPROC
  740:
  750DEF PROCchange_timing
  760REPEAT
  770G%=INKEY(0)
  780IF G%=128 ave%=ave%*2
  790IF G%=129 ave%=ave%/2
  800IF ave%=0 ave%=1
  810UNTIL G%<0
  820PRINT TAB(0,23);SPC(4)
  830IF ave%>4 PRINT;ave%;" "; ELSE PRINT "  ";
  840ENDPROC
  850:
  860DEF PROCerror
  870VDU23,1,1;0;0;0;
  880*FX225,1
  890REPORT
  900PRINT " at line ";ERL
  910ENDPROC

!� Auto resistance measurement
� By Paul Beverley
 � For BBC and Electron-Plus1
� (c) Acorn User April 1985
:
(� 7
2�initialise
<�
F�read_Rs
PRx=(65520/�ADC1-1)*Rs+.0005
Z�calc_range
d�print_prompts
n�display_result
x�change_timing
�� 0
��
�:
�� �initialise
�� � � 7:�error:�
�min%=400
�
ave%=2
�
places%=6
�blank$=�18," ")
�*FX16,4
��23,1,0;0;0;0;
�*FX225,128
��
:
� �read_Rs
Rs=1022.56
"� � �0�256=4
,� �(4)<min% Rs=110.98
6� �(3)<min% Rs=11.0065
@� �(2)<min% Rs=1.0113
J� �(1)<min% Rs=1022.6
Tswitch%=3-�(�(Rs)/�(10))
^�
h:
r� �ADC1
|*FX16,1
�total%=0
�� K%=1�ave%*50
�0� ave%>4 � K%�50=0 � �0,23);ave%-K%�50;"  ";
�
� ��0�256
�total%=total%+�1
��
�*FX16,4
�=total%/ave%/50
�:
�� �calc_range
�range%=4-�(Rx)/�(5)
�� range%>3 range%=3
��
:
� �print_prompts

D$=blank$
&,� range%>0 D$="CLOSE SWITCH  "+�(range%)
0�dprint (0,0,D$)
:
D$=blank$
D3� switch%>0 D$="SWITCH  "+�(switch%)+"  CLOSED"
N�dprint (19,0,D$)
X�
b:
l� �display_result
v� ave%>4 �7
�#R$=��(Rx),places%)+" k ohms   "
�2� Rx>1000 R$=��(Rx/1000),places%)+" M ohms   "
�-� Rx<1 R$=��(Rx*1000),places%)+" ohms   "
��dprint(12,10,R$)
��
�:
�� �dprint(X%,Y%,Z$)
�� �X%,Y%) �(141);Z$
�� �X%,Y%+1) �(141);Z$
��
�:
�� �change_timing
��
G%=�(0)
� G%=128 ave%=ave%*2
� G%=129 ave%=ave%/2
 � ave%=0 ave%=1
*
� G%<0
4� �0,23);�(4)
>"� ave%>4 �;ave%;" "; � � "  ";
H�
R:
\� �error
f�23,1,1;0;0;0;
p*FX225,1
z�
�� " at line ";�
��
�
00000000  0d 00 0a 21 f4 20 41 75  74 6f 20 72 65 73 69 73  |...!. Auto resis|
00000010  74 61 6e 63 65 20 6d 65  61 73 75 72 65 6d 65 6e  |tance measuremen|
00000020  74 0d 00 0f 16 f4 20 42  79 20 50 61 75 6c 20 42  |t..... By Paul B|
00000030  65 76 65 72 6c 65 79 0d  00 14 20 f4 20 46 6f 72  |everley... . For|
00000040  20 42 42 43 20 61 6e 64  20 45 6c 65 63 74 72 6f  | BBC and Electro|
00000050  6e 2d 50 6c 75 73 31 0d  00 19 1f f4 20 28 63 29  |n-Plus1..... (c)|
00000060  20 41 63 6f 72 6e 20 55  73 65 72 20 41 70 72 69  | Acorn User Apri|
00000070  6c 20 31 39 38 35 0d 00  1e 05 3a 0d 00 28 07 eb  |l 1985....:..(..|
00000080  20 37 0d 00 32 0f f2 69  6e 69 74 69 61 6c 69 73  | 7..2..initialis|
00000090  65 0d 00 3c 05 f5 0d 00  46 0c f2 72 65 61 64 5f  |e..<....F..read_|
000000a0  52 73 0d 00 50 1f 52 78  3d 28 36 35 35 32 30 2f  |Rs..P.Rx=(65520/|
000000b0  a4 41 44 43 31 2d 31 29  2a 52 73 2b 2e 30 30 30  |.ADC1-1)*Rs+.000|
000000c0  35 0d 00 5a 0f f2 63 61  6c 63 5f 72 61 6e 67 65  |5..Z..calc_range|
000000d0  0d 00 64 12 f2 70 72 69  6e 74 5f 70 72 6f 6d 70  |..d..print_promp|
000000e0  74 73 0d 00 6e 13 f2 64  69 73 70 6c 61 79 5f 72  |ts..n..display_r|
000000f0  65 73 75 6c 74 0d 00 78  12 f2 63 68 61 6e 67 65  |esult..x..change|
00000100  5f 74 69 6d 69 6e 67 0d  00 82 07 fd 20 30 0d 00  |_timing..... 0..|
00000110  8c 05 e0 0d 00 96 05 3a  0d 00 a0 11 dd 20 f2 69  |.......:..... .i|
00000120  6e 69 74 69 61 6c 69 73  65 0d 00 aa 14 ee 20 85  |nitialise..... .|
00000130  20 eb 20 37 3a f2 65 72  72 6f 72 3a e0 0d 00 b4  | . 7:.error:....|
00000140  0c 6d 69 6e 25 3d 34 30  30 0d 00 be 0a 61 76 65  |.min%=400....ave|
00000150  25 3d 32 0d 00 c8 0d 70  6c 61 63 65 73 25 3d 36  |%=2....places%=6|
00000160  0d 00 d2 13 62 6c 61 6e  6b 24 3d c4 31 38 2c 22  |....blank$=.18,"|
00000170  20 22 29 0d 00 dc 0b 2a  46 58 31 36 2c 34 0d 00  | ")....*FX16,4..|
00000180  e6 12 ef 32 33 2c 31 2c  30 3b 30 3b 30 3b 30 3b  |...23,1,0;0;0;0;|
00000190  0d 00 f0 0e 2a 46 58 32  32 35 2c 31 32 38 0d 00  |....*FX225,128..|
000001a0  fa 05 e1 0d 01 04 05 3a  0d 01 0e 0e dd 20 f2 72  |.......:..... .r|
000001b0  65 61 64 5f 52 73 0d 01  18 0e 52 73 3d 31 30 32  |ead_Rs....Rs=102|
000001c0  32 2e 35 36 0d 01 22 10  f5 20 fd 20 96 30 81 32  |2.56..".. . .0.2|
000001d0  35 36 3d 34 0d 01 2c 19  e7 20 96 28 34 29 3c 6d  |56=4..,.. .(4)<m|
000001e0  69 6e 25 20 52 73 3d 31  31 30 2e 39 38 0d 01 36  |in% Rs=110.98..6|
000001f0  1a e7 20 96 28 33 29 3c  6d 69 6e 25 20 52 73 3d  |.. .(3)<min% Rs=|
00000200  31 31 2e 30 30 36 35 0d  01 40 19 e7 20 96 28 32  |11.0065..@.. .(2|
00000210  29 3c 6d 69 6e 25 20 52  73 3d 31 2e 30 31 31 33  |)<min% Rs=1.0113|
00000220  0d 01 4a 19 e7 20 96 28  31 29 3c 6d 69 6e 25 20  |..J.. .(1)<min% |
00000230  52 73 3d 31 30 32 32 2e  36 0d 01 54 1c 73 77 69  |Rs=1022.6..T.swi|
00000240  74 63 68 25 3d 33 2d a8  28 ab 28 52 73 29 2f ab  |tch%=3-.(.(Rs)/.|
00000250  28 31 30 29 29 0d 01 5e  05 e1 0d 01 68 05 3a 0d  |(10))..^....h.:.|
00000260  01 72 0b dd 20 a4 41 44  43 31 0d 01 7c 0b 2a 46  |.r.. .ADC1..|.*F|
00000270  58 31 36 2c 31 0d 01 86  0c 74 6f 74 61 6c 25 3d  |X16,1....total%=|
00000280  30 0d 01 90 12 e3 20 4b  25 3d 31 b8 61 76 65 25  |0..... K%=1.ave%|
00000290  2a 35 30 0d 01 9a 30 e7  20 61 76 65 25 3e 34 20  |*50...0. ave%>4 |
000002a0  e7 20 4b 25 83 35 30 3d  30 20 f1 20 8a 30 2c 32  |. K%.50=0 . .0,2|
000002b0  33 29 3b 61 76 65 25 2d  4b 25 81 35 30 3b 22 20  |3);ave%-K%.50;" |
000002c0  20 22 3b 0d 01 a4 0d f5  20 fd 96 30 81 32 35 36  | ";..... ..0.256|
000002d0  0d 01 ae 14 74 6f 74 61  6c 25 3d 74 6f 74 61 6c  |....total%=total|
000002e0  25 2b 96 31 0d 01 b8 05  ed 0d 01 c2 0b 2a 46 58  |%+.1.........*FX|
000002f0  31 36 2c 34 0d 01 cc 13  3d 74 6f 74 61 6c 25 2f  |16,4....=total%/|
00000300  61 76 65 25 2f 35 30 0d  01 d6 05 3a 0d 01 e0 11  |ave%/50....:....|
00000310  dd 20 f2 63 61 6c 63 5f  72 61 6e 67 65 0d 01 ea  |. .calc_range...|
00000320  17 72 61 6e 67 65 25 3d  34 2d ab 28 52 78 29 2f  |.range%=4-.(Rx)/|
00000330  ab 28 35 29 0d 01 f4 17  e7 20 72 61 6e 67 65 25  |.(5)..... range%|
00000340  3e 33 20 72 61 6e 67 65  25 3d 33 0d 01 fe 05 e1  |>3 range%=3.....|
00000350  0d 02 08 05 3a 0d 02 12  14 dd 20 f2 70 72 69 6e  |....:..... .prin|
00000360  74 5f 70 72 6f 6d 70 74  73 0d 02 1c 0d 44 24 3d  |t_prompts....D$=|
00000370  62 6c 61 6e 6b 24 0d 02  26 2c e7 20 72 61 6e 67  |blank$..&,. rang|
00000380  65 25 3e 30 20 44 24 3d  22 43 4c 4f 53 45 20 53  |e%>0 D$="CLOSE S|
00000390  57 49 54 43 48 20 20 22  2b c3 28 72 61 6e 67 65  |WITCH  "+.(range|
000003a0  25 29 0d 02 30 14 f2 64  70 72 69 6e 74 20 28 30  |%)..0..dprint (0|
000003b0  2c 30 2c 44 24 29 0d 02  3a 0d 44 24 3d 62 6c 61  |,0,D$)..:.D$=bla|
000003c0  6e 6b 24 0d 02 44 33 e7  20 73 77 69 74 63 68 25  |nk$..D3. switch%|
000003d0  3e 30 20 44 24 3d 22 53  57 49 54 43 48 20 20 22  |>0 D$="SWITCH  "|
000003e0  2b c3 28 73 77 69 74 63  68 25 29 2b 22 20 20 43  |+.(switch%)+"  C|
000003f0  4c 4f 53 45 44 22 0d 02  4e 15 f2 64 70 72 69 6e  |LOSED"..N..dprin|
00000400  74 20 28 31 39 2c 30 2c  44 24 29 0d 02 58 05 e1  |t (19,0,D$)..X..|
00000410  0d 02 62 05 3a 0d 02 6c  15 dd 20 f2 64 69 73 70  |..b.:..l.. .disp|
00000420  6c 61 79 5f 72 65 73 75  6c 74 0d 02 76 0f e7 20  |lay_result..v.. |
00000430  61 76 65 25 3e 34 20 ef  37 0d 02 80 23 52 24 3d  |ave%>4 .7...#R$=|
00000440  c0 c3 28 52 78 29 2c 70  6c 61 63 65 73 25 29 2b  |..(Rx),places%)+|
00000450  22 20 6b 20 6f 68 6d 73  20 20 20 22 0d 02 8a 32  |" k ohms   "...2|
00000460  e7 20 52 78 3e 31 30 30  30 20 52 24 3d c0 c3 28  |. Rx>1000 R$=..(|
00000470  52 78 2f 31 30 30 30 29  2c 70 6c 61 63 65 73 25  |Rx/1000),places%|
00000480  29 2b 22 20 4d 20 6f 68  6d 73 20 20 20 22 0d 02  |)+" M ohms   "..|
00000490  94 2d e7 20 52 78 3c 31  20 52 24 3d c0 c3 28 52  |.-. Rx<1 R$=..(R|
000004a0  78 2a 31 30 30 30 29 2c  70 6c 61 63 65 73 25 29  |x*1000),places%)|
000004b0  2b 22 20 6f 68 6d 73 20  20 20 22 0d 02 9e 15 f2  |+" ohms   ".....|
000004c0  64 70 72 69 6e 74 28 31  32 2c 31 30 2c 52 24 29  |dprint(12,10,R$)|
000004d0  0d 02 a8 05 e1 0d 02 b2  05 3a 0d 02 bc 17 dd 20  |.........:..... |
000004e0  f2 64 70 72 69 6e 74 28  58 25 2c 59 25 2c 5a 24  |.dprint(X%,Y%,Z$|
000004f0  29 0d 02 c6 17 f1 20 8a  58 25 2c 59 25 29 20 bd  |)..... .X%,Y%) .|
00000500  28 31 34 31 29 3b 5a 24  0d 02 d0 19 f1 20 8a 58  |(141);Z$..... .X|
00000510  25 2c 59 25 2b 31 29 20  bd 28 31 34 31 29 3b 5a  |%,Y%+1) .(141);Z|
00000520  24 0d 02 da 05 e1 0d 02  e4 05 3a 0d 02 ee 14 dd  |$.........:.....|
00000530  20 f2 63 68 61 6e 67 65  5f 74 69 6d 69 6e 67 0d  | .change_timing.|
00000540  02 f8 05 f5 0d 03 02 0b  47 25 3d a6 28 30 29 0d  |........G%=.(0).|
00000550  03 0c 18 e7 20 47 25 3d  31 32 38 20 61 76 65 25  |.... G%=128 ave%|
00000560  3d 61 76 65 25 2a 32 0d  03 16 18 e7 20 47 25 3d  |=ave%*2..... G%=|
00000570  31 32 39 20 61 76 65 25  3d 61 76 65 25 2f 32 0d  |129 ave%=ave%/2.|
00000580  03 20 13 e7 20 61 76 65  25 3d 30 20 61 76 65 25  |. .. ave%=0 ave%|
00000590  3d 31 0d 03 2a 0a fd 20  47 25 3c 30 0d 03 34 11  |=1..*.. G%<0..4.|
000005a0  f1 20 8a 30 2c 32 33 29  3b 89 28 34 29 0d 03 3e  |. .0,23);.(4)..>|
000005b0  22 e7 20 61 76 65 25 3e  34 20 f1 3b 61 76 65 25  |". ave%>4 .;ave%|
000005c0  3b 22 20 22 3b 20 8b 20  f1 20 22 20 20 22 3b 0d  |;" "; . . "  ";.|
000005d0  03 48 05 e1 0d 03 52 05  3a 0d 03 5c 0c dd 20 f2  |.H....R.:..\.. .|
000005e0  65 72 72 6f 72 0d 03 66  12 ef 32 33 2c 31 2c 31  |error..f..23,1,1|
000005f0  3b 30 3b 30 3b 30 3b 0d  03 70 0c 2a 46 58 32 32  |;0;0;0;..p.*FX22|
00000600  35 2c 31 0d 03 7a 05 f6  0d 03 84 13 f1 20 22 20  |5,1..z....... " |
00000610  61 74 20 6c 69 6e 65 20  22 3b 9e 0d 03 8e 05 e1  |at line ";......|
00000620  0d ff                                             |..|
00000622
BEVLEY.m0
BEVLEY.m1
BEVLEY.m2
BEVLEY.m4
BEVLEY.m5