Ok, after learning the basics of C, I'm still unfortunately lost. Every single microcontroller "tutorial" (and I've found dozens now) does the exact same thing. They simply have you copy code and then say "VUALA! see it works". This of course is useless.
So if someone can please explain to me code in the $50 robot I would appreciate it. I'll start with "SoR_utils.h"
#define PORT_ON( port_letter, number ) port_letter |= (1<<number)
#define PORT_OFF( port_letter, number ) port_letter &= ~(1<<number)
#define PORT_ALL_ON( port_letter, number ) port_letter |= (number)
#define PORT_ALL_OFF( port_letter, number ) port_letter &= ~(number)
#define FLIP_PORT( port_letter, number ) port_letter ^= (1<<number)
#define PORT_IS_ON( port_letter, number ) ( port_letter & (1<<number) )
#define PORT_IS_OFF( port_letter, number ) !( port_letter & (1<<number) )
DDRC = 0x00; //configure all C ports for input
PORTC = 0x00; //make sure pull-up resistors are turned off
DDRD = 0xFF; //configure all D ports for output
DDRB = 0xC7; //configure B ports 0, 1, 2, 6, 7 for output (google search '0b11000111 to hex')
Obviously I can read the comments in the code and understand in general what each part "does." However, I don't understand why or how it does it. Can someone out there please explain. Thanks