C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
/************************************************
convert each element of a list to its ascii value and its corresponding ascii+parity bit
This is necesary to send this ascii code throw a 7E1 UART (7 data bits + even parity bit)
Upvote if you like it!
Feel free to comnent!
************************************************/
#include <stdio.h>
int main()
{ int i=0;
int j=0;
int test[50]={'\0'};
char a[50] = "Hello from 8051 microcontroller!\r\n";
while (a[i] != '\0'){
test[i] = a[i];
i++;
}
/************************************************
Tenemos una lista test[] con los numeros ascii.
Ahora para cada valor ascii comprobamos paridad
y en su caso añadimos el bit de paridad
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run