12.07.2015 Views

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

Programming Manual Elektor Proton Robot - ELEKTOR.se

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

n--;}}//bit char_in( char c, const char * s );//This functions returns whether character c appears in string s.char CHAR_IN( char c, const char * s ){for(;;){if( *s == '\0' ) return 0;if( *s == c ) return 1;s++;}}//bit STRING_IN( const char * p, const char * q );//This function returns whether the string p appears somewhere in string q.char STRING_IN( const char * p, const char * q ){for(;;){if( STR_PREFIX( p, q )) return 1;if( *q == '\0' ) return 0;q++;}}/*************************************************************************RS232/UART FUNCTIONS - RS232/UART FUNCTIONS - RS232/UART FUNCTIONS**************************************************************************///Initialisation for AVR MEga 16 - 9600 - 8bit - 1 stop - no parity - Xtal 19660800void UART_INIT( void ) \{DDRD |=0b00000010; //TX pin is inputPORTD |=0b00000010;// TX pin is highDDRD &=~0b00000001; //RX pin is input/* Set baud rate */UBRRH = 0x00;UBRRL = 127; //9600/* Enable receiver and transmitter */UCSRB = (1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!