Hi There,
I am writing a code using C and I am designing it to do thefollowing:
– When analogue Joystick is clicked, colour will rotate. So forinstance if clicked it will go from blue to green, if clicked againit will go green to red, if clicked again it will go from red backto blue.
– I cant add any additional libraries and everything has to bein C
Right now with the code I have written it glitches with thecolours and sometimes will stay on the same colour or will gobackwards.
What my code is doing currently:https://youtu.be/XQY9noM7QiQ
What it should be doing:https://www.youtube.com/watch?v=Dp-KIz-cBvQ
Code:
///////////////////////////////////////////////////////////////////
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{ //////////JOYSTICK/////////
PayPal Gateway not configured
PayPal Gateway not configured