I have problem in send a serial data via USART it's send a ASCII not decimal.
this is my code :
while(!(UCSRA&(1<<UDRE))){}
UDR=12;
and this is header :
UBRRH=(uint8_t) (UBRR_CALC>>8);
UBRRL=(uint8_t) (UBRR_CALC);
UCSRB=(1<<TXEN)|(1<<RXEN);
UCSRC=(1<<URSEL)|(3<<UCSZ0);
how to send decimal data , i want to read from an ADC and send with USART...
Thank you very much
If 'decimal' means string representation of numbers to you, you should look at
sprintforitoa.You need a character buffer that can be filled by one of these functions with a string representing your number.
Please read a C-Tutorial or book about different basic data types especially the difference between characters/strings and integral data types.