Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Then i might be backwards to.
Can you tell me is the output from the 311 meant to turn the motor on or is it turn the motor off.
What is the switch meant to do.
I forget the actual procedure how this function now please refresh me.
Pete.
This could be correct if above code dont work.
Code:main: if input4 = 0 AND input3 = 0 then high 2 ;gas and switch ON, wait 12s and Motor ON pause 200 endif if input4 = 1 OR input3 = 1 then low 2 ; gas OR switch OFF, Motor OFF - if the flame is on in the middle pause 200 endif goto main
Pete.
main:
if input4 = 0 then
low 2 ; gas OR switch OFF, Motor OFF - if the flame is on in the middle
pause 200
endif
if input4 = 1 AND input3 = 0 then
pause 12000
high 2 ;gas and switch ON, wait 12s and Motor ON
endif
if input4 = 1 AND input3 = 1 then
low 2 ; gas OR switch OFF, Motor OFF - if the flame is on in the middle
pause 200
endif
goto main
CODE REMOVED TO SAVE CONFUSION
Whoops...................
I had pin3 and pin4 backwards above.
TRY THIS ONE............
Code:symbol switch_1 = pin4 symbol C_311 = pin3 symbol motor = 2 symbol Y = b1 main: if C_311 = 1 AND switch_1 = 0 then Delay if C_311 = 0 OR switch_1 = 1 then low 2 ; gas OR switch OFF, Motor OFF - if the flame is on in the middle endif goto main Delay: for Y = 0 to 11 wait 1 if C_311 = 1 AND switch_1 = 0 then next Y endif if C_311 = 1 AND switch_1 = 0 then gosub Gas_on endif goto main Gas_on: high 2 ;gas and switch ON, wait 12s and Motor ON return
symbol switch_1 = pin3
symbol C_311 = pin4
symbol motor = 2
symbol Y = b1
main:
if C_311 = 1 AND switch_1 = 0 then Delay
if C_311 = 0 OR switch_1 = 1 then
low 2 ; gas OR switch OFF, Motor OFF - if the flame is on in the middle
endif
goto main
Delay:
for Y = 0 to 11
wait 1
if C_311 = 1 AND switch_1 = 0 then
next Y
endif
if C_311 = 1 AND switch_1 = 0 then
gosub Gas_on
endif
goto main
Gas_on:
high 2 ;gas and switch ON, wait 12s and Motor ON
return
'THIS VERSION 0005 BY SABORN
symbol switch_1 = pin4
symbol C_311 = pin3
symbol motor = 2
symbol Y = b1
main:
if C_311 = 0 AND switch_1 = 0 then Delay
if C_311 = 1 OR switch_1 = 1 then
low 2 ; gas OR switch OFF, Motor OFF - if the flame is on in the middle
endif
goto main
Delay:
for Y = 0 to 11
wait 1
if C_311 = 0 AND switch_1 = 0 then
next Y
endif
if C_311 = 0 AND switch_1 = 0 then
gosub Gas_on
endif
goto main
Gas_on:
high 2 ;gas and switch ON, wait 12s and Motor ON
return
You are mixing up the various lots of code and using the incorrect pin labelled code to modifie.
It is this one you should be using. TRY IT AGAIN!!!
Code:'THIS VERSION 0005 BY SABORN symbol switch_1 = pin4 symbol C_311 = pin3 symbol motor = 2 symbol Y = b1 main: if C_311 = 0 AND switch_1 = 0 then Delay if C_311 = 1 OR switch_1 = 1 then low 2 ; gas OR switch OFF, Motor OFF - if the flame is on in the middle endif goto main Delay: for Y = 0 to 11 wait 1 if C_311 = 0 AND switch_1 = 0 then next Y endif if C_311 = 0 AND switch_1 = 0 then gosub Gas_on endif goto main Gas_on: high 2 ;gas and switch ON, wait 12s and Motor ON return
Can you tell me in English how this system is meant to operate, dont worry about pin numbers just the human operation, as you would for telling me before you had built the circuit.
I am still somewhat confused over how all this operates and trying to write code with guessing what i think is correct.
The code works fine it is just not in the correct order for how the circuit is operating.
Pete.
main:
if input4 = 1 AND input3=0 then
pause 12000
high 2
else
low 2
endif
goto main
The way the whole thing is supposed to work is as follows:
When we turn the gas nob a switch is turned on and pin3 of the 08M is High.
If there is a flame, then the thermistor gets hot and the output of the 311 goes High the 08M output is now Low and the motor is OFF.
If there is NO flame then the thermistor stays cold and the output of the 311 is Low, the 08M output is now Low and the motor is ON.
As the motor turns the nob around the switch turns OFF and the 08M pin3 goes LOW, causing the motor to turn OFF again.
Hope this is clear?
Now my code needs to reflect the fact that the output of the 08M is ONLY high when pin3 of the chip is High (the switch is ON) and pin4 is Low (there is NO flame).
If there is NO flame then the thermistor stays cold and the output of the 311 is Low, the 08M output is now Low and the motor is ON.
'THIS VERSION 0006 BY SABORN
#picaxe 08m2
symbol switch_1 = pinC.4
symbol C_311 = pinC.3
symbol motor = C.2
symbol Y = b1
main:
if C_311 = 0 AND switch_1 = 1 then Delay
if C_311 = 1 OR switch_1 = 0 then
low motor ; gas OR switch OFF, Motor OFF - if the flame is on in the middle
endif
goto main
Delay:
for Y = 0 to 11
wait 1
if C_311 = 0 AND switch_1 = 1 then
next Y
endif
if C_311 = 0 AND switch_1 = 1 then
gosub Gas_on
endif
goto main
Gas_on:
high motor ;gas and switch ON, wait 12s and Motor ON
return
'THIS VERSION 0007 BY SABORN
' pin4 moved to pin1
#picaxe 08m
symbol switch_1 = pin1
symbol C_311 = pin3
symbol motor = 2
symbol Y = b1
main:
if C_311 = 0 AND switch_1 = 1 then Delay
if C_311 = 1 OR switch_1 = 0 then
low motor ; gas OR switch OFF, Motor OFF - if the flame is on in the middle
endif
goto main
Delay:
for Y = 0 to 11
wait 1
if C_311 = 0 AND switch_1 = 1 then
next Y
endif
if C_311 = 0 AND switch_1 = 1 then
gosub Gas_on
endif
goto main
Gas_on:
high motor ;gas and switch ON, wait 12s and Motor ON
return
One of us is not correct here and i think it is you, as for starters the switch is connected to INPUT PIN4 and the 311 is connected to INPUT PIN3 not as you have listed above.
Are you sure like 100% sure the 311 output is LOW with no flame, and HIGH after 12 seconds with a flame present, as i had thought it was the other way around.
I dont know if your thermister is a NTC or a PTC thermister so i am unable to work it out from the circuit.
Then this................
If the output of the 08m is LOW then the motor will be OFF, it needs a high on the output to turn the fet on which will turn the motor on.
From what you have told me for the operation and with correcting the input pins for the right function then this code should be correct.
I have also changed the code to make it written for the picaxe 08m2 chip.
Pete.
Code:'THIS VERSION 0006 BY SABORN #picaxe 08m2 symbol switch_1 = pinC.4 symbol C_311 = pinC.3 symbol motor = C.2 symbol Y = b1 main: if C_311 = 0 AND switch_1 = 1 then Delay if C_311 = 1 OR switch_1 = 0 then low motor ; gas OR switch OFF, Motor OFF - if the flame is on in the middle endif goto main Delay: for Y = 0 to 11 wait 1 if C_311 = 0 AND switch_1 = 1 then next Y endif if C_311 = 0 AND switch_1 = 1 then gosub Gas_on endif goto main Gas_on: high motor ;gas and switch ON, wait 12s and Motor ON return
One of us is not correct here and i think it is you, as for starters the switch is connected to INPUT PIN4 and the 311 is connected to INPUT PIN3 not as you have listed above.
If there is NO flame then the thermistor stays cold and the output of the 311 is Low, the 08M output is now Low and the motor is ON.
Work from the diagram in the manual (in the PE help section under manual 1)
There is this diagram and when we talk code and pin numbers we use the numbers on the outside of the drawing and NOT the numbers inside the square.
Pete.