I am running into a problem when I try to verify and compile this program. I am fairly new to the Arduino but I can kind of tell what is going on. I also know why I am getting this error, but I'm not sure how to fix it.
You can find the entire program here: http://sites.google.com/site/onewheeledselfbalancing/Home/links-to-other-self-balancing-projects/self-balancing-software
Sorry for the link, but it is a very large program.
The problematic Section is in the very beginning when Ports are declared. It uses 4 ports but the Arduino only has 3.
void InitPorts(void)
{
PORTC=0x00; //Port C pullups set to low (no output voltage) to begin with
DDRC=0xFF; //Port C pins all set as output via the port C direction register
DDRA=0x00; //all port A pins set as input
PORTA=0x00; //Port A input pullups set to low pullups
DDRD=0xFF; //Configure all port D pins as output as prerequisite for OCR1A (PinD5) and OCR1B (Pin D4)
//working properlyPORTB=0x00; //Port B pullups set to low (no output voltage) to begin with
DDRB=0xFF; //All port B pins set to output
}
/* IO:
I am using ATMega32 16MHz with external crystal clock. New planned pin arrangement to OSMC motor controller
PD5/OC1A ALI -> OSMC pin 6
PD4/OC1B BLI -> OSMC pin 8
PC1 Disable -> OSMC pin 4
PC2 BHI -> OSMC pin 7
PC3 AHI -> OSMC pin 5
PB2 Pulse to socket for connection to oscilloscope, one pulse per cycle of programInputs:
PA0/ADC0 accelerometer
PA1/ADC1 pitch rate gyro
PA2/ADC2 overallgain (via cutout switch) PA2
PA3/ADC3 Position lever pulled back position PA3
PA4/ADC4 "Throttle Pedal" control knob - controls how fast it accelerates when deliberately tipped
by rider PA4
PA5/ADC5 Position lever pushed forwards position PA5*/
What do I need to do to fix this here and throughout the program? I will take any and every suggestion. Just please help.