示例#1
0
//send IR bursts for time specified (microseconds)
void burst(int length) {
	while (length > 0) {
		send_high();
		send_low();
		length -= IR_DELAY * 2;
	}
	PORTB &= ~(1 << IR_LED);
}
void ir_send_message(uint16_t message) {
    PORTB |= _BV(PB0); // debug led on
    send_start_stop();
    uint8_t i = 16;
    do {
        i--;
        if (message & (1 << i)) {
            send_high();
        } else {
            send_low();
        }
    } while(i > 0);
    send_start_stop();
    PORTB &= ~_BV(PB0); // debug led off
}