Before sending, the cells in the shaping array are converted into ASCII array, and then sent according to the general sending function.
void InttoChar (uint IntNumber)
// -
//Name:void intto char(int int number)
// Func。 : Converts an integer to an ASCII character array.
// Char。 : IntNumber The number to be converted to ASCII characters.
// -
{
if(int number & lt; 10)
{
asciarray[0]= int number+0x 30;
asciarray[ 1]= 0x 20;
asciarray[2]= 0x 20;
asciarray[3]= 0x 20;
asciarray[4]= 0x 20;
Return;
}
if(int number & lt; 100)
{
asciarray[0]= int number/ 10+0x 30;
asciarray[ 1]= int number % 10+0x 30;
asciarray[2]= 0x 20;
asciarray[3]= 0x 20;
asciarray[4]= 0x 20;
Return;
}
if(int number & lt; 1000)
{
asciarray[0]= int number/ 100+0x 30;
asciarray[ 1]= int number % 100/ 10+0x 30;
asciarray[2]= int number % 10+0x 30;
asciarray[3]= 0x 20;
asciarray[4]= 0x 20;
Return;
}
if(int number & lt; 10000)
{
asciarray[0]= int number/ 1000+0x 30;
asciarray[ 1]= int number % 1000/ 100+0x 30;
asciarray[2]= int number % 100/ 10+0x 30;
asciarray[3]= int number % 10+0x 30;
asciarray[4]= 0x 20;
Return;
}
other
{
asciarray[0]= int number/ 10000+0x 30;
asciarray[ 1]= int number % 10000/ 1000+0x 30;
asciarray[2]= int number % 1000/ 100+0x 30;
asciarray[3]= int number % 100/ 10+0x 30;
asciarray[4]= int number % 10+0x 30;
Return;
}
}