Computing desk | ||
---|---|---|
< April 19 | << Mar | April | May >> | April 21 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Will cloud storage replace USB sticks? Clover345 ( talk) 16:14, 20 April 2013 (UTC)
I'm trying to make a clock on an Arduino Uno. I have a real time clock where I'm getting data from. Page 11 of the datasheet has the table of values such as seconds, minutes, hours, etc. I'm having trouble with the BCD to decimal conversion though. In my fumblings, I've been able to get the date set on the RTC. The time was set at one point but is now several hours off.
So, I'm trying to display this on an LCD. The time displays fine. Well, I think it does. I haven't watched it for a full 24 hours but I've seen the hours/minutes/seconds tick over like they should during a day. So far I haven't seen anything unusual like more than 60 minutes in an hour. I'm having trouble with the date though. I can't get the numbers to display correctly. For instance, the clock shows that we're on the 25th day of the 16th month. So, here's what I have for the time:
seconds = (((seconds & 0b11110000)>>4)*10 + (seconds & 0b00001111)); // convert BCD to decimal
minutes = (((minutes & 0b11110000)>>4)*10 + (minutes & 0b00001111));
hours = (((hours & 0b00100000)>>5)*20 + ((hours & 0b00010000)>>4)*10 + (hours & 0b00001111)); // (24 hour mode)
And here is what I have for the date:
day = (day & 0b00000111); //convert BCD to decimal
date = (((date & 0b00110000)>>4) + (date & 0b00001111));
month = (((month & 0b00010000)>>4) + (month & 0b00001111));
year = (((year & 0b11110000)>>4) + (year & 0b00001111));
Can anyone tell me what I'm doing wrong with the conversion? There's obviously something that I'm not getting. Thanks, Dismas| (talk) 16:55, 20 April 2013 (UTC)
Our article Advanced chess deals with computer-assisted humans playing against other computer-assisted humans. Have any organized matches occurred where a human and a weaker computer face a stronger computer opponent that has no human help? To what extent can the human provide an advantage? Neon Merlin 19:03, 20 April 2013 (UTC)
Computing desk | ||
---|---|---|
< April 19 | << Mar | April | May >> | April 21 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Will cloud storage replace USB sticks? Clover345 ( talk) 16:14, 20 April 2013 (UTC)
I'm trying to make a clock on an Arduino Uno. I have a real time clock where I'm getting data from. Page 11 of the datasheet has the table of values such as seconds, minutes, hours, etc. I'm having trouble with the BCD to decimal conversion though. In my fumblings, I've been able to get the date set on the RTC. The time was set at one point but is now several hours off.
So, I'm trying to display this on an LCD. The time displays fine. Well, I think it does. I haven't watched it for a full 24 hours but I've seen the hours/minutes/seconds tick over like they should during a day. So far I haven't seen anything unusual like more than 60 minutes in an hour. I'm having trouble with the date though. I can't get the numbers to display correctly. For instance, the clock shows that we're on the 25th day of the 16th month. So, here's what I have for the time:
seconds = (((seconds & 0b11110000)>>4)*10 + (seconds & 0b00001111)); // convert BCD to decimal
minutes = (((minutes & 0b11110000)>>4)*10 + (minutes & 0b00001111));
hours = (((hours & 0b00100000)>>5)*20 + ((hours & 0b00010000)>>4)*10 + (hours & 0b00001111)); // (24 hour mode)
And here is what I have for the date:
day = (day & 0b00000111); //convert BCD to decimal
date = (((date & 0b00110000)>>4) + (date & 0b00001111));
month = (((month & 0b00010000)>>4) + (month & 0b00001111));
year = (((year & 0b11110000)>>4) + (year & 0b00001111));
Can anyone tell me what I'm doing wrong with the conversion? There's obviously something that I'm not getting. Thanks, Dismas| (talk) 16:55, 20 April 2013 (UTC)
Our article Advanced chess deals with computer-assisted humans playing against other computer-assisted humans. Have any organized matches occurred where a human and a weaker computer face a stronger computer opponent that has no human help? To what extent can the human provide an advantage? Neon Merlin 19:03, 20 April 2013 (UTC)