updated example in readme for new interface

This commit is contained in:
Jake Goodwin 2023-01-15 14:37:57 -08:00
parent ed2e9d0f82
commit b68248e069
1 changed files with 20 additions and 5 deletions

View File

@ -29,13 +29,28 @@ likely end up being the end result.
```C
#include "avr_usart.h"
void send_bt_cmd(char* cmd) {
/*
*Description: Echos a single char back to the term.
*/
void echo_char(char* cmd) {
init_usart();
unsigned char data[] = "AT+WAKE\0";
uint8_t result = usart_send_str(data);
if(result) {
raise_error();
unsigned char data[1] = "0";
uint8_t data_len = 1;
//clear the buffer
serial0_flush_rxbuf();
//receive the char.
serial0_read(data, data_len);
//Now echo it.
serial0_write(data, data_len);
}
int main() {
while(1) {
echo_char();
}
}