Wednesday, 20 January 2010

The Dial

The dial that controls awake time is now completed with the real time clock. The dial will automatically set off the night time alarm as well.

The dial has been separated into 12 sections or ranges from 0 - 12. Each section has a different alarm time, e.g:

at 0: the time set here is 6am AND 9pm

timeSetValue = analogRead(timeDial); //find what value the dial is sitting at

if(timeSetValue/68 == 0){ // if value = 0 then it is pointing to 6am

if(hour == 6 && minute == 0){ // so at 6am signal
digitalWrite (ledred, HIGH);
digitalWrite (ledred, LOW);

else if(hour == 21 && minute == 0){ //AND signal at 9pm, still based on the same value.
digitalWrite (ledred, HIGH);

From this, i started to roughly mark out around the dial what value it is (pink) and therefore what time is being activated(black). In this image, you can see that the pointer is over 7am which will activate the 7am alarm along with 22pm alarm automatically.

There is also some circuit problems i need to speak to mike about. The dial will only ever give me my full range of 0 - 12 when plugged straight into my arduino board and not when in my bread board for some reason...

I am also ordering a multi-sector potentiometer that clicks when it is turned between it's values.

No comments:

Post a Comment