I am new to AVR, but i have programmed PICs before, only this time i am doing everything in linux too so you'll guess that i am using avrdude...
My goal for this project is to change a bicolor LED's color depending on a certain state.
By default, the led is RED (if you make the connections right of course), then i want it to go to yellow (which is a quick change between green and red) while the user is holding the button down then on release, it will go to green, then the next time it will turn off.
So, to recap,
LED is red
While i hold the button down its gonna be yellow
When i release it will be green
While i hold the button down again its gonna be yellow
When i release it will be off
While i hold the button down again its gonna be yellow
When i release it will be red (and so on...)
In my actual code, everything works really well sometimes, but sometimes the led gets stuck at yellow and i have no clue why
Any ideas?
Code is on ideone : http://ideone.com/LI9gH
Thanks