Go Down

Topic: Int to str. (Read 680 times) previous topic - next topic


Here's what i need to do..

Code: [Select]

byte h,m,s;
  h = RTC.get(DS1307_HR,true);  //12
  m = RTC.get(DS1307_MIN,true); //55
  s = RTC.get(DS1307_SEC,true);  //

char TimeStr[6] //store values here
int LenOfStr;

TimeStr = h + " : " + M + ":" + S;
LenOfStr = Length(TimeStr);
Serial.println(TimeStr);  //12:55:0

//Above code wont compile, but that's the result i'm looking for, char arrays C ctyle :(
//but - I need to know the exact length of the string

I need to convert Hours, Minutes and Seconds  into a char string, i've been trying atoi and itoa.



oh yeah, forgot all about that :) - cheers

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131