Im trying to set the time on the software RTC using the setTime(1,15,0,1,1,10); function
the values in setTime go as follows: setTime(hour,minute,second,month,day,year);
so, setTime(1,15,0,1,1,10); would be 1:15 am 00 seconds, january 1st 2010
Im trying to assign int's to each of the (hour,minute,second,month,day,year) parameters but so far, i can only set the hour. I think it has something to do with Serial.flush(); or while statement but cant figure it out.
It's not clear what the exact problem is from your description, but I see a couple of obvious issues. Why do you say you can only set the hour? What happens with the code you posted? Have you tried without the call to flush()? I don't see any value in calling it by the way.
Also you'll need to convert the return values from read() into a number. From memory the read() function returns the ASCII value. Oh and you know that read() returns a single byte right? So if you punch '12' into your serial monitor in response to "Enter Hour:" you'll get back the ASCII code for '1'.
Serial.flush(); is a function that is almost never required and almost always destructive, or misused at best, in most normal sketches. If you can't state a specific reason for why and for when to use a flush command, then you probably should not be using it.