Easy questions, I’m frankly a little embarrassed to be asking:
My last ‘serious’ programming was many hours of basic on a commodore VIC-20 so I may be a touch rusty… :oops:
- Running a loop for repetitive tasks.
For some reason I can’t simply figure out how to use a ‘for-loop’ to complete a repetitive task. As simple as possible: how do I write a loop to, let’s say, blink the LED 5 times in a row without simply writing the on-off sequence 5 times? I should be able to write a for loop and then include the on-off seq in the {} following the loop line, but it doesn’t seem to take.
( I’m working on an automatic cat feeder but the LED demo will answer the question!)
- IF-AND-ELSE condition.
Again as simple as possible, If I write a program that one button turns on LED1, and the second button lights LED2 (no problem solving this…), how do I structure the program to turn on LED3 if BOTH buttons are pressed?
- (which you may want to answer instead of the previous 2!)…
Bought The Sparkfun inventors kit this week and am having a blast with it! Have sold at least another 4 boards in the few days since to other friends and family who are intrigued by what we can cook up. Turns out these are a great tool to unleash the inner inventor/mad scientist!
However… none of us have any experience in programming in ‘C’. Can anyone point me in the direction of a good book or resource to take a virtual beginner to the next level? (meaning fewer questions of the caliber I have just posted!) The kit projects are a ton of fun, but I’d really like to depart off the path and start to see more original ideas realized, and progress along the way.
Thanks a ton!