hi guys, I'm new here, to MCUs, and C, but not coding or electronics. I was working on a project and someone said I can do it better with an MCU, so I've been giving it a shot, but the C amd coding are throwing me for a bit of a loop. I'm a .NET and UI programmer and designer, so this is different for me. I'm just hoping I can get some help.
My concept is simple. It's basically an LED flash, a power led, a shutter push button, function push button (on/off)...
I have my flash/shutter down. Easy peasy. But coding a function push button is harder. I was thinking of using an integer that would be increments up with each press and reset after 2. 1, 2 and reset, 1, 2 and reset... And so on. And then use an if then to determine what would happen with other functions depending on the function integer value.
I also though about using a CD4013 to flip flop two pins hi and low. And then just poll those pins and use an if then based on a hi/low input.
if I could get a quick tutorial on how to do both in code, it'd make my day because I could really use both methods for lots of neat stuff. Thank you guys so much for any help.
PS: I'm using The ATMega48A. It seems to be the cheapest and best for my needs. I also have a copy of MikroBasic, so if I can do this in basic, I'd be ecstatic. Mychal gracias, my new friends!