hi, we are making a SumoRobot, and we need that detect white and black color, we are using the AVR studio 4 software and axon microcontroller hardware, and a CNY70 sensor, but the AVR dont have library of CNY70 sensor and I dont know how conect and I dont know how program this sensor, this is my code.
#include<avr/IO.h>
#include "sys/axon.h"
DDRA = 0xFF;
void appInitHardware(void){
pin_make_output(C0, TRUE);
pin_make_input(A0, TRUE);
}
TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
return 0;
}
TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) {
if (pin_is_high(A0)){
pin_is_high(C0);
}
else{
pin_is_low(C0);
}
return 1;
}
please help me.