Hi
I am trying to write a code to for serial communication between a module and my baby orangutan. For now I am trying to test my code first with HyperTerminal to make sure it is working. I am using baby orangutan 328p lib for serial communication. All what I need for now is to send bunch of char to baby orangutan. If the right char received in a particular position in an array, LED will be ON otherwise it will be OFF.
I already check another code just to send a char from the baby orangutan to the HyberTerminal and it work. but the receiving part is not working yet.
#include <avr/io.h>
#include <util/delay.h>
#include <pololu/orangutan.h>
int main ()
{
char receive_buffer [2] = {'R','D'};
DDRC = 0xFF;
serial_set_baud_rate(115200);
while (1)
{
serial_receive(receive_buffer ,sizeof(receive_buffer));
if (receive_buffer [2] == 'A');
PORTC &= (1 << PC0);
_delay_ms(5000);
}
}
Anyone can tell what is wrong with my code? I will be really grateful.