Number Conversion

Hello Everyone :slight_smile:
I would like to ask for your assistance with my project if i may. I am trying to make a talking clock/Thermometer unit using :An Arduino Uno. DS1302 Clock Module. Sparkfun 102 Temperature Module.[/li][/list]
The demo sketches work and mashed together to get a good readout.
My problem is that I am not able to get the sketch to recognize the numbers. I am missing the piece that makes it work . Thank you ahead of time, for helping me complete this task.

char ssr[500]="Good Morning , ";

void loop(){

ds1302_struct rtc;
char buffer[80]; // the code uses 70 characters.
// Read all clock data at once (burst mode).
DS1302_clock_burst_read( (uint8_t *) &rtc);
sprintf( buffer, "Time = %02d:%02d:%02d, ",
bcd2bin( rtc.h24.Hour10, rtc.h24.Hour),
bcd2bin( rtc.Minutes10, rtc.Minutes),
bcd2bin( rtc.Seconds10, rtc.Seconds));
Serial.print("Time,dec:");
SpeechSynthesis.mvm(ssr,6,buffer);
sprintf(buffer, "Date(day of month) = %d, Month = %d, "
"Day(day of week) = %d, Year = %d",
bcd2bin( rtc.Date10, rtc.Date),
bcd2bin( rtc.Month10, rtc.Month),
rtc.Day,
2000 + bcd2bin( rtc.Year10, rtc.Year));
Serial.print( buffer);
SpeechSynthesis.mvm(ssr,2,buffer);
SpeechSynthesis.mvm(ssr,4,buffer);
SpeechSynthesis.Ecommand(0,16,7,ssr);

delay(200);

float celsius = getTemperature();
Serial.print("Celsius: ");
SpeechSynthesis.mvm(ssr,6,"Celsius");
Serial.println(celsius);

delay(300);

float fahrenheit = (1.8 * celsius) + 32;
Serial.print("Fahrenheit: ");
SpeechSynthesis.mvm(ssr,4,"Fahrenheit");
Serial.println(fahrenheit);

Hi, can you please read this thread and then post your sketch in # code tags, this will make it easier to read, also post the complete sketch so we can see how you have defined variables and libraries.

http://forum.arduino.cc/index.php?topic=149014.0

Hope to help.. Tom....... :slight_smile:

Hello Mr. George,
Thank you for your reply! The complete sketch is too long to post, but is attached. I had edited my previous post so as to fit.

Time_Temperature_Module_2.ino (15.5 KB)

char ssr[500]="Good Morning , ";

If you can't count, you really should let the compiler count for you. Which Arduino are you using? Can you really afford to waste nearly 1/4 of the memory, assuming a 328-based Arduino, for this string?

   sprintf( buffer, "Time = %02d:%02d:%02d, ", \
    bcd2bin( rtc.h24.Hour10, rtc.h24.Hour), \
    bcd2bin( rtc.Minutes10, rtc.Minutes), \
    bcd2bin( rtc.Seconds10, rtc.Seconds));

The backslashes are not necessary, and distract from the code.

Hello Mr. S.
First off, it is the Arduino Uno R3. yes it is a 328, and I am always up for learning a better way to write code. Thank you for your help with the backlashes.