Hi, I am trying to retrieve data from an array "Buf" to register but am unable to do so. Below is my code: >>>> long T_msec,Div= 360000; int T_hours; char Buf[3]; while(1) { check_digit(); T_msec = oncount; T_hours = (int)(T_msec/Div); sprintf(Buf,"%ud",(int)(T_msec/Div)); hour0digit = Buf[0]; hour1digit = Buf[1]; hour2digit = Buf[2]; // hour3digit = Buf[3]; p07 = 0; } <<<< Please help me.. Aniket
not
sprintf(Buf,"%ud",(int)(T_msec/Div));
sprintf(Buf,"%u",(int)(T_msec/Div));
Hi, I have a 4byte count which i have to reduce and display it on a 7 segment display in three digits hour0digit,hour1digit & hour2digit respectively. Below i have given an example count which is in miliseconds and i have to convert it to hours. Ex: 252000000ul; //700 hours; Thanks and regards, Aniket
hi, I am trying to retrieve data from an array "Buf" to register but am unable to do so.
char Buf[3]; sprintf(Buf,"%ud",(int)(T_msec/Div));