Microcontroller › 8051 › Transmitting an integer serially by AT89S51 › Hi Saad,You can transmit a
March 11, 2013 at 4:49 pm
#9298
Participant
Hi Saad,
You can transmit a single digit integer like this.
If you have a single digit integer, say ‘7’ stored in a variable ‘i’
int i = 7
Now you can transmit the ‘7’ using the following,
SBUF = ‘0’ + i; //Simply adding the value to the ascii value of zero
Hope this helps.