/********************************************* * Author: Chris @ PyroElectro.com * * Description: This firmware is for the transmitter * side of the wireless IR communication tutorial * on PyroElectro.com. The USART module is turned on * and then begins sending data out the Tx pin. The * data is a count value that increments every USART * Tx cycle, 0 -> 8. * * Date: July 25th, 2011 * * For Full Details On This Firmware Please * Visit: http://www.pyroelectro.com/tutorials/wireless_infrared_communication/ *********************************************/ #include #include #include void main(void){ unsigned char rs232_s = '1'; OpenUSART( USART_TX_INT_OFF & USART_RX_INT_OFF & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_HIGH, 25 ); while(1){ putcUSART(rs232_s); Delay10KTCYx(10); rs232_s += 1; if(rs232_s == '8') rs232_s='0'; } }