ASCII Serial Com
Serial communication library between computers, microcontrollers, FPGAs, etc. Uses only ASCII. Not the most efficient protocol, but meant to be easy to read
Loading...
Searching...
No Matches
arduino_uno_write_message_to_serial.c
1#include "asc_helpers.h"
2#include "avr/avr_uart.h"
3#include <avr/io.h>
4
5#define FOSC 16000000L
6#define BAUD 9600
7#define MYUBRR (FOSC / 16 / BAUD - 1)
8#define UART_NO 0
9
10#define bufCap 64
11
12static const char message[] = ">00s0 0 0 0.DE10\n";
13static const uint8_t message_len = 17;
14uint8_t iChar = 0;
15
16int main(void) {
17
18 UART_Init(UART_NO, MYUBRR, 0);
19
20 while (1) {
21 uart_tx_blocking(UART_NO, message[iChar]);
22 iChar++;
23 if (iChar == message_len) {
24 iChar = 0;
25 }
26 }
27 return 0;
28}
#define uart_tx_blocking(uart_no, _tmp_byte)
#define UART_Init(uart_no, ubrr, rxIntEnable)
Initialize USART.
Definition avr_uart.h:20