hi!
I'm planning to make an line follower bot using the axon mcu and some Ir sensors. For the programming part i referred the photovore program and i found the libraries are specific for ATmega8 uC. So i need to edit the library files according to ATmega640 rite? and according to the pins i connect the sensors to the mcu board, say if i connect the left sensor to ADC pin 1 & right sensor to ADC pin2, left servo to pin E2 & right servo to pin E3, what are all the things do i need to change in the library files? and this is my program
[code]#include "SoR_Utils.h"
int main(void)
{
int sensor_left=0;
int sensor_right=0;
configure_ports();
a2dInit();
a2dSetPrescaler(ADC_PRESCALE_DIV32);
a2dSetReference(ADC_REFERENCE_AVCC);
LED_off();
while(1)
{
sensor_left=a2dConvert8bit(1);
sensor_right=a2dConvert8bit(2);
if(sensor_right<sensor_right)
turn right;// needs modification
else if(sensor_left<sensor_right)
turn left;//needs modification
else
go straight;//needs modification
return 0;
}
[/code]
sorry for not writing comments in the programs!