Loading...
  Show Posts
Pages: 1 ... 10 11 [12] 13 14 ... 16
166  Using Arduino / Project Guidance / Re: timing within a loop on: May 14, 2012, 09:53:36 am
one more thing, (just to make it a bit simpler, base this on button examle) when the button pin goes low there would be a delay of upto 30seconds before the LED goes low, but if the button is only on for a period of 10seconds then the LED will only stay on after the button goes low for 10seconds. hope you understand what i mean there

also the delay time needs to be without a delay like the example blink without delay.

thanks joe
167  Using Arduino / Project Guidance / Re: timing within a loop on: May 14, 2012, 09:24:46 am
hi there think i have figured it now

Code:

int ledPin =  13;    // LED connected to digital pin 13
int button = 2;      // button pin

int count = 0;       // Our blink counter

// The setup() method runs once, when the sketch starts

void setup()   {               
  // initialize the digital pin as an output:
  pinMode(ledPin, OUTPUT);
  pinMode(button, INPUT); 
}

// the loop() method runs over and over again,
// as long as the Arduino has power

void loop()                   
{
  if (digitalRead(button)== HIGH)  // buttin when high
  {
  if (count < 1) {
    digitalWrite(ledPin, HIGH);   // set the LED on
    delay(1000);                  // wait for a second
    digitalWrite(ledPin, LOW);    // set the LED off
    delay(1000);                   // wait for a second
   
    count++;  // add one (1) to our count
  }
  }
  else {
    if(count == 1) count =0;       // resetting the count
  }
}
168  Using Arduino / Project Guidance / Re: timing within a loop on: May 13, 2012, 08:51:40 am
ok
do we have an example of this?
169  Using Arduino / Project Guidance / Re: timing within a loop on: May 13, 2012, 08:00:20 am
hi yes i would have put it in setup but i need it to do it the first revolution everytime when the heat button goes high. obviously it resets when it goes low
170  Using Arduino / Project Guidance / Re: timing within a loop on: May 13, 2012, 03:22:37 am
hope this is beter
Code:

const int heatbutton     = 2 ;
const int ignition_fan_2 = 10;
const int saleswitch     = 4 ;
const int solenoid       = 12;
const int photo_pressure = 3 ;
const int lockoutled     = 8 ;
const int heatbutton_feed= 5 ;
const int fan            = 9 ;
const int relay230_24    = 11;
const int ionisation_in  = 7 ;
int ionisation     = 5 ;   

void setup()
{
  pinMode(heatbutton,       INPUT );   
  pinMode(ignition_fan_2,   OUTPUT);
  pinMode(saleswitch,       INPUT );
  pinMode(solenoid,         OUTPUT);
  pinMode(photo_pressure,   INPUT );
  pinMode(lockoutled,       OUTPUT);
  pinMode(heatbutton_feed,  OUTPUT);
  pinMode(fan,              OUTPUT);
  pinMode(relay230_24,      OUTPUT);
  pinMode(ionisation_in,    INPUT );
  //-------------------------------------------
  digitalWrite(heatbutton_feed, HIGH);
}

void loop() {
  int val = analogRead(ionisation);
  //--------------------------------------------------------------------

  if (digitalRead(heatbutton)==        HIGH) {
    //                                                  ** from here need's to just run once **

    if (digitalRead(ionisation_in)==   HIGH) {       // if ionisation swith HIGH
      if (val >900)  {
        digitalWrite(solenoid,              LOW);                                       
        digitalWrite(lockoutled,            HIGH);
        digitalWrite(heatbutton_feed,       LOW);
      }
    }   
    else {
      if (digitalRead(photo_pressure)==     HIGH) {         // if photo swith HIGH
        digitalWrite(lockoutled,            HIGH);                                       
        digitalWrite(solenoid,              LOW);
        digitalWrite(heatbutton_feed,       LOW);
      }
    }
    digitalWrite(relay230_24,            HIGH);        // 230V out put to ignition
    digitalWrite(fan,                    HIGH);
    digitalWrite(ignition_fan_2,         HIGH);
    delay(2000);       
    //                                                           ** to this point **

    //---------------------------------------------------------------------
    if (digitalRead(saleswitch)==HIGH) {           // sale switch if HIGH
      digitalWrite(solenoid,     HIGH);
    }
    //---------------------------------------------------------------------
    else {                                            // sale switch if LOW
      digitalWrite(lockoutled,      HIGH);
      digitalWrite(ignition_fan_2,  LOW);
      digitalWrite(solenoid,        LOW);
      digitalWrite(fan,             LOW);
      digitalWrite(heatbutton_feed, LOW);
    }
    //---------------------------------------------------------------------
    delay(2000);
    if (digitalRead(ionisation_in)== HIGH) {
      if (val >900)                         {            // ionisation if LOW
        digitalWrite(solenoid,        LOW);
        digitalWrite(ignition_fan_2,  LOW);
        digitalWrite(lockoutled,      HIGH);
        digitalWrite(heatbutton_feed, LOW);
        digitalWrite(heatbutton_feed, LOW);
      }
    }

    if (digitalRead(photo_pressure)==LOW)  {          // photo if LOW
      digitalWrite(solenoid,         LOW);
      digitalWrite(ignition_fan_2,   LOW);
      digitalWrite(lockoutled,       HIGH);
      digitalWrite(heatbutton_feed,  LOW);
    }
    //---------------------------------------------------------------------
    else {
      digitalWrite(ignition_fan_2, LOW);
    }
    //---------------------------------------------------------------------
  }
  else {                                          // switching off
    digitalWrite(solenoid,       LOW);
    digitalWrite(ignition_fan_2, LOW);
    digitalWrite(relay230_24,    LOW);
    delay(30000);
    digitalWrite(fan,            LOW);
  }
  //---------------------------------------------------------------------

}
171  Using Arduino / Project Guidance / Re: timing within a loop on: May 12, 2012, 03:22:55 pm
i have written in the code which bit i want to run once
 
Code:
void loop() {
     int val = analogRead(ionisation);
   //--------------------------------------------------------------------
   
    if (digitalRead(heatbutton)==      HIGH) {
    //                                                                                                         ** from here need's to just run once **
    if (digitalRead(ionisation_in)==   HIGH) {       // if ionisation swith HIGH
    if (val >900)  {
    digitalWrite(solenoid,              LOW);                                       
   digitalWrite(lockoutled,             HIGH);
  digitalWrite(heatbutton_feed,         LOW);
   }
 }   
  else {
  if (digitalRead(photo_pressure)==     HIGH) {         // if photo swith HIGH
   digitalWrite(lockoutled,             HIGH);                                       
   digitalWrite(solenoid,               LOW);
  digitalWrite(heatbutton_feed,         LOW);
   }
 }
  digitalWrite(relay230_24,            HIGH);        // 230V out put to ignition
  digitalWrite(fan,                    HIGH);
  digitalWrite(ignition_fan_2,         HIGH);
  delay(2000);       
    //                                                                                                         ** to this point **
  //---------------------------------------------------------------------
  if (digitalRead(saleswitch)==HIGH) {           // sale switch if HIGH
  digitalWrite(solenoid,       HIGH); }
  //---------------------------------------------------------------------
  else {                                            // sale switch if LOW
   digitalWrite(lockoutled,      HIGH);
   digitalWrite(ignition_fan_2,  LOW);
   digitalWrite(solenoid,        LOW);
   digitalWrite(fan,             LOW);
   digitalWrite(heatbutton_feed, LOW);
   }
  //---------------------------------------------------------------------
  delay(2000);
   if (digitalRead(ionisation_in)== HIGH) {
  if (val >900)                         {            // ionisation if LOW
   digitalWrite(solenoid,          LOW);
   digitalWrite(ignition_fan_2,    LOW);
   digitalWrite(lockoutled,        HIGH);
   digitalWrite(heatbutton_feed,   LOW);
   digitalWrite(heatbutton_feed,   LOW);
   }
 }
   
   if (digitalRead(photo_pressure)==LOW)  {          // photo if LOW
     digitalWrite(solenoid,         LOW);
   digitalWrite(ignition_fan_2,    LOW);
   digitalWrite(lockoutled,        HIGH);
   digitalWrite(heatbutton_feed,   LOW);
   }
   //---------------------------------------------------------------------
   else {
       digitalWrite(ignition_fan_2, LOW); }
   //---------------------------------------------------------------------
   }
   else {                                          // switching off
        digitalWrite(solenoid,       LOW);
        digitalWrite(ignition_fan_2, LOW);
         digitalWrite(relay230_24,   LOW);
        delay(30000);
        digitalWrite(fan,            LOW); }
   //---------------------------------------------------------------------
   
       }
172  Using Arduino / Project Guidance / timing within a loop on: May 12, 2012, 02:42:58 pm
hi there
i have a code that runs when an input is high which obviously runs over and over continously as long as the button is high but the first half of the code i only want to run once but obviously if the button goes low then high again it will reset and will obviously do the first half again once?

thanks Joe
173  Using Arduino / Programming Questions / Re: ionisiation? on: March 05, 2012, 12:08:00 pm
ok thanks
what do we call high voltage?
174  Using Arduino / Programming Questions / Re: ionisiation? on: March 03, 2012, 10:32:35 am
how would i wire it for high voltage?
diagram
175  Using Arduino / Programming Questions / Re: ionisiation? on: March 02, 2012, 01:17:10 pm
what switch the live instead of the 0v?
176  Using Arduino / Programming Questions / Re: ionisiation? on: March 01, 2012, 01:55:09 pm
hi there
i have been playing with different resistances. im up in the 2000k to get it to work on my test rig on my finished product i might be able to get it lower than that but i was wandering is it ok to use these sorts of resistances?
177  Using Arduino / Programming Questions / Re: ionisiation? on: February 17, 2012, 11:46:29 am
hi again
i have made bit of a rig up and ran your theory above and i couldnt seem to get it to work at all. i think there is a bit more to it than i originally thought ?
178  Using Arduino / Programming Questions / Re: ionisiation? on: February 11, 2012, 01:20:00 pm
ok thanks will have to have a play with that when i get time
179  Using Arduino / Programming Questions / Re: ionisiation? on: February 11, 2012, 12:33:15 pm
ok cool
just to clarify where exactly should i put the resistor?

thanks
180  Using Arduino / Programming Questions / Re: ionisiation? on: February 11, 2012, 12:08:49 pm
just found this link just a bit of general info about it. i havent gor any pics just a piece of ceramic with a metal bar going through it which is in the flame and th ceramic insulates it from the chassis
didnt know if anybody has played with this is the arduino world

http://www.petervis.com/electronics%20guides/polonium%20detector/ionisation%20chamber.html
Pages: 1 ... 10 11 [12] 13 14 ... 16