I am building a simple circuit that consists of just a 08M2 chip and a momentary button on pinC.2
The idea is to press the button to go to the next label for doing a test.
The test is to find out the real value of a resistor in a ladder on C.1 and have that value read back on the computer screen.
I have written the code as I think it should be, but when I run it in simulation I get this error message that it is out of memory.
This is quite beyond me, I am not familiar enough to know why.
The idea is to press the button to go to the next label for doing a test.
The test is to find out the real value of a resistor in a ladder on C.1 and have that value read back on the computer screen.
I have written the code as I think it should be, but when I run it in simulation I get this error message that it is out of memory.
This is quite beyond me, I am not familiar enough to know why.
Code:
; Function: test ladder value
; Last Revision:
; Target PICAXE:
; *******************************
Symbol Res_Ladder1= C.1
Symbol Ladder_Value = b0
Main:
button1:
if pinC.2 = 1 then button2
readadc Res_Ladder1,Ladder_Value ; read ADC Pin into Ladder Value (variable b0)
sertxd("Value of button1 ADC is ",#Ladder_Value,13,10) ; transmit to computer
pause 1800 ; short delay
goto button1
button2:
if pinC.2 = 1 then button3
readadc Res_Ladder1,Ladder_Value ; read ADC Pin into Ladder Value (variable b0)
sertxd("Value of button2 ADC is ",#Ladder_Value,13,10) ; transmit to computer
pause 1800 ; short delay
goto button2
button3:
if pinC.2 = 1 then button4
readadc Res_Ladder1,Ladder_Value ; read ADC Pin into Ladder Value (variable b0)
sertxd("Value of button3 ADC is ",#Ladder_Value,13,10) ; transmit to computer
pause 1800 ; short delay
goto button3
button4:
if pinC.2 = 1 then button5
readadc Res_Ladder1,Ladder_Value ; read ADC Pin into Ladder Value (variable b0)
sertxd("Value of button4 ADC is ",#Ladder_Value,13,10) ; transmit to computer
pause 1800 ; short delay
goto button4
button5:
if pinC.2 = 1 then button6
readadc Res_Ladder1,Ladder_Value ; read ADC Pin into Ladder Value (variable b0)
sertxd("Value of button5 ADC is ",#Ladder_Value,13,10) ; transmit to computer
pause 1800 ; short delay
goto button5
button6:
if pinC.2 = 1 then button7
readadc Res_Ladder1,Ladder_Value ; read ADC Pin into Ladder Value (variable b0)
sertxd("Value of button6 ADC is ",#Ladder_Value,13,10) ; transmit to computer
pause 1800 ; short delay
goto button6
button7:
if pinC.2 = 1 then button8
readadc Res_Ladder1,Ladder_Value ; read ADC Pin into Ladder Value (variable b0)
sertxd("Value of button7 ADC is ",#Ladder_Value,13,10) ; transmit to computer
pause 1800 ; short delay
button8:
readadc Res_Ladder1,Ladder_Value ; read ADC Pin into Ladder Value (variable b0)
sertxd("Value of button8 ADC is ",#Ladder_Value,13,10) ; transmit to computer
Last edited: