Hi together,
here is what i want to realize:
-
I have a little arduino UNO circuit consisting of a servo (pin 11), an RGB-LED (pin 3,4,5), a potentiometer (A0) and a pushbutton (named "sketchbutton"; pin 9; including pull-down resistor).
-
do have three independent sketches - each one with different controlling of the circuit
- the first performs a motion when sketchbutton is pressed (lets name it "motion")
- second performs motion-sequence when sketchbutton is pressed (lets name it "motion-sequence")
- third allows manually positioning of the servo by help of the poti (lets name it "positioning")
now i would like to combine those three sketches and use another pushbutton (lets name it "choosebutton") (pin 8 ) to choose the sketch that is currently active. For visualization (so that you know you activated the right part of the sketch) the LED should be illuminated in one of the three colours.
- for motion --> blue
- for motion-sequence --> green
- for positioning --> red
so finally it should look somehow like this:
if choosebutton is pressed once in quick succession
--> activate the motion loop
--> let LED shine blue
if choosebutton is pressed twice in quick succession
--> activate the motion-sequence loop
--> let LED shine green
if choosebutton is pressed three times in quick succession
--> activate the positioning loop
--> let LED shine red
Is that possible? Can someone maybe please help me and provide me with the code or helpful URL