Author Topic: Need help with code to add a button to change array speed  (Read 1870 times)

0 Members and 1 Guest are viewing this topic.

Offline c3d20Topic starter

  • Contributor
  • Posts: 18
Need help with code to add a button to change array speed
« on: August 16, 2012, 03:16:37 pm »
Arduino Uno.



Help is very much appreciated.




Put this into a case:


This is what I had when first writing the script which I dont even think would have worked and anyway is now uncompatible to do this action:
you get the idea though of what I was trying to do :)

Code: [Select]
buttonPin2State = digitalRead(buttonPin2);

if((buttonPin2State== HIGH) && (digitalRead(ledPin3) == HIGH)) {
for (count=0;count<5;count++ ) {
digitalWrite(pinArray[count], HIGH);
delay(timer*2);
digitalWrite(pinArray[count], LOW);
delay(timer);
}
}
else if ((buttonPin2State == HIGH) && (digitalRead(ledPin5) == HIGH)) {
for (count=0;count<5;count++) {
digitalWrite(pinArray[count], HIGH);
delay(timer);
digitalWrite(pinArray[count], LOW);
delay(500);
}
}
else if((buttonPin2State== HIGH) && (digitalRead(ledPin6) == HIGH)) {
for (count=0;count<5;count++) {
digitalWrite(pinArray[count], HIGH);
delay(400);
digitalWrite(pinArray[count], LOW);
delay(200);
}}}
« Last Edit: August 17, 2012, 02:49:33 am by c3d20 »
 

Offline c3d20Topic starter

  • Contributor
  • Posts: 18
Re: Need help with code to add a button to change array speed
« Reply #1 on: August 16, 2012, 04:58:41 pm »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf