LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

chnage int and double to ASCII

I need to change int's and doubles to ASCII for transmission via RS232 to a STAMP BS2P module.
0 Kudos
Message 1 of 2
(3,119 Views)
ComWrt writes a string to a previously initialized COM port.
sprintf() uses a format string to create a string from other data types.
int myInt=0;
double myDouble=1.23;
char myString[256];
sprintf(myString, "I bought %d apples at $%.2f each.\n",myInt, myDouble);
ComWrt (1, myString, strlen(myString));
0 Kudos
Message 2 of 2
(3,119 Views)