In SX Microcontrollers, SX/B Compiler and SX-Key Tool, DJFX wrote: Now that worked but now I modified it and it doesn't work. Here is the new code: ' ------------------------------------------------------------------------- ' Program Description ' ------------------------------------------------------------------------- ' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX FREQ 4_000_000 ' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------- Gas VAR RC.1 Flow VAR RC.2 Temp VAR RC.3 Solenoid VAR RB.0 Fan VAR RB.1 Alarm1 VAR RB.2 Alarm2 VAR RB.3 temp0 VAR Byte temp3 VAR Byte ' ------------------------------------------------------------------------- ' Main ' ------------------------------------------------------------------------- Start: LOW Solenoid LOW Fan LOW Alarm1 LOW Alarm2 Main: temp0 = Flow + Temp temp0 = temp0 + ~Gas ' temp0 can ONLY be 0 if Flow=0, Temp=0, and Gas=1 alarm dange level temp3 = Flow & Temp temp3 = temp3 & Gas ' temp1 can ONLY be 1 if Flow=1, Temp=1, and Gas=1 alarm dang level rising IF temp0 = 0 THEN Solenoid = 0 Fan = 1 Alarm1 = 1 Alarm2 = 0 IF temp3 = 1 THEN Solenoid = 1 Fan = 0 Alarm1 = 0 Alarm2 = 1 ENDIF Solenoid = 1 Fan = 0 Alarm1 = 0 Alarm2 = 0 ENDIF GOTO Main Any Help is greatly appreciated. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99428#m99621 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)