Forum Replies Created
-
AuthorPosts
-
January 7, 2015 at 10:50 am in reply to: Convert ‘ unsigned long int ‘ to ‘string’ without using inbuilt function for UART #12500Jayant GuptaParticipant
thanks Sasa.. ur post provided me a lot of help and i implemented it sucessfully
i had to make certain small changes to get it working .. i really appreciate ur help without it would have been lil difficult understanding further step.
i am posting the code here jus incase someone might need it.
void convert_l2s(unsigned long int data0, unsigned char temp_buffer[8])
{
temp_buffer[0]=(data0/1000000)+0x30;
data0%=1000000;
UART_Write_Byte(temp_buffer[0]);
temp_buffer[1]=(data0/100000)+0x30;
data0%=100000;
UART_Write_Byte(temp_buffer[1]);
temp_buffer[2]=(data0/10000)+0x30;
data0%=10000;
UART_Write_Byte(temp_buffer[2]);
temp_buffer[3]=(data0/1000)+0x30;
data0%=1000;
UART_Write_Byte(temp_buffer[3]);
temp_buffer[4]=(data0/100)+0x30;
data0%=100;
UART_Write_Byte(temp_buffer[4]);
temp_buffer[5]=(data0/10)+0x30;
UART_Write_Byte(temp_buffer[5]);
temp_buffer[6]=(data0%10)+0x30;
UART_Write_Byte(temp_buffer[6]);
temp_buffer[7]=0;
UART_Write_Byte(temp_buffer[7]);
}i am trying to generalize it using loop for n digits int type!!
do i need to use a similar approach for float data as well???
December 31, 2014 at 11:51 am in reply to: Convert ‘ unsigned long int ‘ to ‘string’ without using inbuilt function for UART #12484Jayant GuptaParticipant*t_buffer= data0;
means nothing its a part of the previous method i tried which didnt work.
pls IGNORE this part!!!!
i simply want to sent the content of variable data0 over uart right after i send hello over uart.
do i need to write separate program for separating the digits and send them over uart one by one as char values???
Jayant GuptaParticipantyes my abjective is to see the output on the lcd as
TEMP:#degreeC
# gives the output from the DS1621 sensor.
i have some how manage to work on the I2C protocol but i m not sure is it right or wrong since lcd interfacing in not yet successful
secondly i have tried the lcd part too but i am not able append it properly in te code. i am confused with the delays that i am giving.
even though i refered to previous suggestion but i m not able to successful in the program.
i haven’t figured a way to call the value in tempHI register onto the lcd and finding it quite hard to understanding any other method of projecting the data.
-
AuthorPosts