Arduino programming

Arduino programming

Hourly – More than 6 months - 10-30 hrs/week - Posted

Job Description

I have many arduino projects I need help with. I currently have one that is partially done I could use someone to finish up the programming. I will add in more info about the specific job soon. I hope to find someone who I can hire on a regular basis. Hope this can become regular work with various projects.



I have experience with programming arduino but it may be better to just hire someone to do the work for me. So I do have an idea how long things should take. I have found wild ranges of times to get jobs done. I prefer paying someone higher per hour who can get the work done in a short time then someone that charges little per hour and then claims a project will take many more hours.

For this first project I have 5 leds. I want them to all light up for 5 seconds when a microswitch/pushbutton has been hit. Then I want all but one to light up for another 5 seconds. Then I want all of them to turn off. It could be totally random which led stays on or it could go through a pattern where the first time the button is pressed the 1st led will light up, the second time the 5 led will light up, etc to appear to be random.

I have included the code I have so far below. The specifics of how you get the leds to go on is not important. Some possibilities I think are to keep track of times the button has been counted and change the button is pressed, it might be possible to have it turn out a random led each time. If you do have a different led light up depending on which time the button was hit I do not want it to be the first time is the first button the second time the second button, etc but want something more random and only need each led to light up once in the sequence so 5 times. You also may need to add in a debounce but it may not be neceesarry and will be very little extra code.

Here is the code so far this works but it does not allow for differnt leds to be on by themselves just the first led every time.

const int buttonPin = 7; // the number of the pushbutton pin
const int led = 2; // LED 1 control pin is set up as an output
const int led2 = 3; // same for LED 2 to LED 5
const int led3= 4;
const int led4= 5;
const int led5= 6;


int buttonState = 0;

void setup() {
// initialize the LED pin as an output:
pinMode(2, OUTPUT); // LED 1 control pin is set up as an output
pinMode(3, OUTPUT); // same for LED 2 to LED 5
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}

void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
delay(5000);
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(5000);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);

}

}

Other open jobs by this client