newbie progamme advice

hi all, i have spent the last week doing as suggested on this and other sites and reading as much as i can.
i have an arduino with a tinkerkit sensor sheild fitted for this project.
this is for my work and hopefully will be fitted in a finished product.
basically it will control a simple RO (reverse osmosis) unit.
i have succesfully run blink etc and modded it a bit
what it needs to do: wait 20 seconds,check the inlet pressure is not below a setpoint(this is a pressure switch so just on/off)
if no pressure,wait 20 seconds again(do this max 5 times)if still no pressure,light warning lamp and wait 30 minutes then repeat.
if pressure ok, check for high pressure, if high, stop and light warning lamp.
if ok run pump relay
edit: hopefully this will constantly check those inputs while running, or am i missing something?

below is where i have got to now but am struggling where to start next so would be gratefull for a clue :slight_smile:
also, can the reset button on the arduino be accessed via the pins or does it just reset the board?

 [quote]
[color=#7E7E7E]// ro progam//[/color]
[color=#7E7E7E]// setup pressure switches and pump relay//[/color]

[color=#CC6600]const[/color] [color=#CC6600]int[/color] LowPress = A0;             [color=#7E7E7E]//low pressure switch//[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] HighPress = A1;            [color=#7E7E7E]//high pressures switch//[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] relay = 03;                [color=#7E7E7E]// pump relay//[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] OnLamp = 00;               [color=#7E7E7E]// on/run lamp[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] FaultLamp = 01;            [color=#7E7E7E]//stop/fault lamp//[/color]

[color=#7E7E7E]// set the states of the pins//[/color]

[color=#CC6600]const[/color] [color=#CC6600]int[/color] [color=#CC6600]state[/color] = [color=#006699]HIGH[/color];            [color=#7E7E7E]// current state of the output pin//[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] = reading;               [color=#7E7E7E]// current reading from the input pin//[/color]
[color=#CC6600]const[/color] [color=#CC6600]int[/color] = previous = [color=#006699]LOW[/color];        [color=#7E7E7E]// previous reading fro input pin//[/color]

[color=#7E7E7E]//debounce for switches//[/color]

[color=#CC6600]long[/color] time =0;
[color=#CC6600]long[/color] debounce =200;

[color=#7E7E7E]// setup pins as in/out//[/color]

[color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]()
{
  [color=#CC6600]pinMode[/color](LowPress,[color=#006699]INPUT[/color]);                        [color=#7E7E7E]//low pressure switch//[/color]
  [color=#CC6600]pinMode[/color](HighPress,[color=#006699]INPUT[/color]);                       [color=#7E7E7E]//high pressure switch//[/color]
  [color=#CC6600]pinMode[/color](relay,[color=#006699]OUTPUT[/color]);                          [color=#7E7E7E]//pump relay//[/color]
  [color=#CC6600]pinMode[/color](OnLamp,[color=#006699]OUTPUT[/color]);                         [color=#7E7E7E]//on/run lamp//[/color]
  [color=#CC6600]pinMode[/color](FaultLamp,[color=#006699]OUTPUT[/color]);                      [color=#7E7E7E]//stop/faultlamp//[/color]
}

[color=#7E7E7E]//start,wait 20 seconds while check inlet low press,if low,wait again(do this max 5 times)if still no pressure,light fault lamp, wait 30 minutes and try routine again.//[/color]
[color=#7E7E7E]//if pressure ok, check high pressure, if high,stop and light fault lamp. if ok run pump and light on lamp//[/color]



[color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]()
{
[color=#CC6600]delay[/color] (20000);

[/quote]

You'll need to post that again, without all the color tags.

just copy your arduino code from the arduino editor.
then before it in the textbox type {code} and end with {/code} however use square brackets like you used in the color code instead of the { }

dont know what happened there, used the copy for forum option

// ro progam//
// setup pressure switches and pump relay//

const int LowPress = A0;             //low pressure switch//
const int HighPress = A1;            //high pressures switch//
const int relay = 03;                // pump relay//
const int OnLamp = 00;               // on/run lamp
const int FaultLamp = 01;            //stop/fault lamp//

// set the states of the pins//

const int state = HIGH;            // current state of the output pin//
const int = reading;               // current reading from the input pin//
const int = previous = LOW;        // previous reading fro input pin//

//debounce for switches//

long time =0;
long debounce =200;

// setup pins as in/out//

void setup()
{
  pinMode(LowPress,INPUT);                        //low pressure switch//
  pinMode(HighPress,INPUT);                       //high pressure switch//
  pinMode(relay,OUTPUT);                          //pump relay//
  pinMode(OnLamp,OUTPUT);                         //on/run lamp//
  pinMode(FaultLamp,OUTPUT);                      //stop/faultlamp//
}

//start,wait 20 seconds while check inlet low press,if low,wait again(do this max 5 times)if still no pressure,light fault lamp, wait 30 minutes and try routine again.//
//if pressure ok, check high pressure, if high,stop and light fault lamp. if ok run pump and light on lamp//



void setup()
{
delay (20000);

hope that works

used the copy for forum option

That's what happened. That needs ripping out of the IDE.