Hey
I am using the AXE092 experimenter board with the 08M chip and have it linked to a breadboard with a thermistor and a 4026B 7segment display set up.
I want the 7 segment display to count from 0-9 or 9-0 (preferably 9-0), then read the thermistor, display the temperature as a number and light up the red LED when that temperature isn’t in a safe limit.
I am new to this and don’t really understand it fully. I’ve managed to mash together a bit of code but when I download it to the board, rather than the 7seg counting down the Red LED flashes 9 times!
Could you point out where I’m going wrong, if I’m even going right at all. Thanks.
I am using the AXE092 experimenter board with the 08M chip and have it linked to a breadboard with a thermistor and a 4026B 7segment display set up.
I want the 7 segment display to count from 0-9 or 9-0 (preferably 9-0), then read the thermistor, display the temperature as a number and light up the red LED when that temperature isn’t in a safe limit.
I am new to this and don’t really understand it fully. I’ve managed to mash together a bit of code but when I download it to the board, rather than the 7seg counting down the Red LED flashes 9 times!
Could you point out where I’m going wrong, if I’m even going right at all. Thanks.
Code:
'I/O lines:
'0 - reset 7 seg display output
'1 - count 7 seg display output
'2 - red LED output
'3 - input unused
'4 - input from thermistor (ADC)
'variable used:
'b0 - ADC value (0 to 255) from thermistor (input 3)
'b1 - number of clock pulses to be sent to output 1
'b2 - loop counter for number of clock pulses
main: 'procedure for initial countdown
for b1 = 0 to 9
let pins=b1
pause 1000 'Pause 1 second
next b1 'Next
goto temp 'Measure temperature
temp: 'procedure for temperature reading
readadc 4, b0 'take reading from thermistor
if b0<80 then level0
if b0<120 then level1
if b0<140 then level2
if b0<160 then level3
if b0<190 then level4
if b0<205 then level5
if b0<220 then level6
if b0<225 then level7
if b0<235 then level8
goto level9
level0: 'procedure for temp <10C
let b1 = 0 'set variable b1 to 0
gosub clock 'go to "clock" sub-procedure
high 0
level1: 'procedure for temp 11-20C
let b1 = 1
gosub clock
high 0
level2: 'procedure for temp 21-30C
let b1 = 2
gosub clock
…etc etc…
clock: 'procedure to send output to display
pulsout 1,10 'reset display to zero
if b1 = 0 then endclk
for b2 = 1 to b1
pulsout 0,10
next b2
endclk: 'procedure to end clock
return 'return from sub-procedure