Binary Operators
Trying to write in code that controls waste oil heater, I am using a DS2760 thermocouple and a SX28 that , what I would like to do Is set a output high and then turn it off and stop the program when the temp gets over 140 C degrees . The SX dose not have a Binary operator > greater than which is what I have used in the past with basic Stamp. If I use the code in the SXB editor it runs but wont work. Shutdown is a Sub that turns off the pin that drives a AC relay. Thanks David
Basic code that works ======== IF tempF > 340 THEN LOW OT1
SXB code ================ IF tempC => 140 GOTO Shutdown
Basic code that works ======== IF tempF > 340 THEN LOW OT1
SXB code ================ IF tempC => 140 GOTO Shutdown
Comments
The reason is that IF-THEN implies a GOTO (compiles to JMP @Label), not GOSUB (compiles to CALL @Label).
· The technical term is is "borrowing" code [noparse];)[/noparse]
· I'm not sure what you are trying to do in the "Control" routine ??? Exactly what do you want to happen at what temperatures ???
· You can·use the "temperature" variable, just make sure you do it BEFORE the LCD routine. Because the LCD routine destroys the value in "temperature".
· Also, the value in "temperature" is in 0.1'C units. So 140'C will be the value 1400 (NOT 140). This may be what was causing you grief.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
·The next time you need a hero don't look up in the sky...Look in the mirror.
Post Edited (Bean (Hitt Consulting)) : 12/24/2008 1:57:44 PM GMT
Please post the BS24p code.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
·The next time you need a hero don't look up in the sky...Look in the mirror.
·