Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
So, my questions is this: I'd like to know how your sourcecode knows that the servo_left variable is the left servo on the hardware. Or backwards, how does the chip know, what variable stores what command for what piece of hardware?
#define LEFT_SERVO PORTB1
At the top of Your code You create macros that basically change the name say from PORTB1 to LEFT_SERVO. Since You declare that You want to give pin the other name, You can access that pin with its new name. This is used to make code more readable, as LEFT_SERVO is easier to understand than PORTB1.Code: [Select]#define LEFT_SERVO PORTB1
PORTB |= (1 << PB3);