- This topic has 1 reply, 2 voices, and was last updated 11 years, 7 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › Transmitting an integer serially by AT89S51
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.