/* * Author: Jake Goodwin * Date: 2023 * Description: Small library to communicate with the AT-09 bluetooth module. */ #include #include #include #include #include "avr_usart.h" //############################# //Globals //############################# int main() { unsigned char* tx_buffer[16]; unsigned char* rx_buffer[16]; led_blink(); led_blink(); led_blink(); _delay_ms(1000); _delay_ms(1000); init_usart0(); //enable interrupts sei(); unsigned char data[] = "AT+WAKE"; while(1) { _delay_ms(1000); //led_blink(); for(uint8_t i = 0; i < 7; i++) { tx_usart0(data[i]); } } return 0; } //############################# //FUNCTIONS //############################# /* * Input: None * Output: None * Description: init usart0 hardware in async mode */ void init_usart0(void) { //DDRB |= (1<>8); //UBRR0L |= (uint8_t) BT_UBRR; UBRR0H |= (uint8_t) (0x33>>8); UBRR0L |= (uint8_t) 0x33; //Enable recv and Transmit pins, overrides other uses. //IN the usart control and status register 0B UCSR0B = (1<