Join us in Chat. Click link in menu bar to join. Unofficial chat day is every Friday night (US time).
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);
Started by hazzer123
Started by Orrin
Started by dannytemmerman
Started by Jak24
Mechanics and Construction