Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

two functions at once
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

two functions at once

by MrChippy on Fri Jun 13, 2008 10:30 am

I went through the ladyada's lesson 5. but want to add a couple functions to the last code, but it's starting to confuse the heck out of me. basically all I need to do is run a continuous function along with the if functions. so for example I have a constant blinking led set on pin 12, a button is set on pin 2, and another led on pin 11, when the button is pressed pin 11's led changes rate but pin 12 led stays the same. when looking through Arduino Programming Notebook it seams the "while" statement is what I need basically I'm just having trouble with placement, would it be placed after "void loop" right before "val = digitalRead(switchPin);" , or would I place it before if (lightMode == 0) { // all-off". or am I completely incorrect here? any help is appreciated, Thanks
MrChippy
 
Posts: 4
Joined: Mon May 19, 2008 11:07 pm

Please be positive and constructive with your questions and comments.


cron