Hi, another simple question.I have modified some of the examples of different effects (4 in total) and i would like to replay them separately from individual button from digital pins. I have the hardware side sorted using pull up resistors but i can’t seem to get my head round what code i need and where it gets inserted.
I am using 3.1 on an Arduino Uno
Hi Ross Malyon, you need to go through the basic examples that came with the installation of the Arduino IDE.
Within the Arduino IDE, check the:
/files/examples/02.digital
section for many examples on how to handle digital inputs.
If you understand the basics of handling the state of a switch connected to a digital input pin, I guess the next step for you would be to learn about ‘Switch case’ handling. Again you can find some examples of how these work in:
/files/examples/05.Control
Except for a few variable declarations, all of the code you will need will be located inside the main loop().
JP, thanks. It all complies ok, just have to see how it looks this weekend. I’ll let you know. I am using this for my college project (even though i am 50) to help me understand about C programming.
@Ross_Malyon Join the gang, I’m actually closer to 60 than 50 now and semi-retired.
I have started with Arduino and RGB LEDs a bit more than a year ago to start playing with programming and only discovered this group a few months ago. I have received really great support here and I am very happy if I can help in return !