this is my first coding experience and looking for someone to help me write some code for a Arduino id be willing to trade some fg or d2 items for some working code. iv been fucking with it for a week now cant seem to figure it out
iv posted on there forums but didn't get much help
so what i want to happen is when a button is pushed:
LED1 ON wait 500ms then LED2 ON wait 2000ms then LED3 ON wait 2000ms then LED4 ON wait 2000ms then LED4 ON wait 2000ms the LED5 ON wait 10000ms
then LED6 on wait 500ms then LED7 on
then keep the LEDs on until the button is released then turn them all OFF
and if the button "stutters" start from the beginning.
this is what i got so far
Code
const int buttonPin = 1;
const int LED1 = 2;
const int LED2 = 3;
const int LED3 = 4;
const int LED4 = 5;
const int LED5 = 6;
const int LED6 = 7;
const int LED7 = 8;
int buttonState = 0;
void setup ()
{
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
pinMode(LED7, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop (){
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
digitalWrite(LED1, HIGH); // #1 on
delay(1000); //wait
digitalWrite(LED2, HIGH); // #2 on
delay(1500); //wait
digitalWrite(LED3, HIGH); // #3 on
delay(1500); //wait
digitalWrite(LED4, HIGH); // #4 on
delay(1500); //wait
digitalWrite(LED5, HIGH); // #5 on
delay(120000); //wait
digitalWrite(LED6, HIGH); // #6 on
delay(500); //wait
digitalWrite(LED7, HIGH); // #7 on
}
else {
// all off
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);
digitalWrite(LED6, LOW);
digitalWrite(LED7, LOW);
}
}
but because i was using the delay() function for the wait times it wont read the button pin state till it has made it past the delay() then shut off and this will not work for what i want to end up doing with this code witch is controlling a oxygen compressor and it would over shoot the set psi mark if that is the case.
any thoughts? my brain is about fried

thanks