- a wee sentence summarizing your sleep experience waking on demand.
- bed time and awake time/ or duration of sleep - not lies in -
- when you know you have to get up early, what do you do, if anything, different to your routine?
- what alarm system do you use? sound produced?
- your awake rating from 1 to 10 (10 = best, 1 = worst).
Thursday, 14 January 2010
Data collection question
To collect a bit of data to PLAY around with, i have been asking a range of people to answer these :
Wednesday, 13 January 2010
Buttons
Step 1: keep time with on / off button.
Step 2: alarm to go off when hour and min is set, e.g. 7:30
Step 3: snooze
Step 1:To do this, i am using if statements with an anolog input.
The on / off button works by using this command:
// read the state of the set button value:
buttonSet = digitalRead(dayoff); // check if the dayoff button is pressed.
if (buttonSet == HIGH) { // if it has NOT been pressed, complete these steps
digitalWrite(ledgreen, HIGH); // turn green on:THIS IS TO ACT AS AN INDICACTOR!!
This still keeps time and can turn output off any time in code once pressed. This means my on / off button acts as setting the alarm and turning it off on signal. This is good as it means less buttons!!
Step 2: The tough part!
Changing the source; I've tried now, using LOTS of different codes to try and send the alarm signal to go off with an hour and min being specified.
The most affective so far is going back to my ' if else' statements.
if (hour == 8) {
digitalWrite(ledred, HIGH); // turn on red
This will reconise the hour, but using such commands as
if (hour ==8) { if (second ==10)} (seconds used as faster)
digitalWrite(ledred, HIGH); // turn on red
This sets the alarm to go off at 08:00:10 but at 08:00:11 it will come back on again...
if (hour ==8) { if (second >10)} (seconds used as faster)
digitalWrite(ledred, HIGH); // turn on red
This sets the alarm to go off at anything over 08:00:10 but it will come back on again at a new minute over 10 seconds 08:01:11...
I cannot get the alarm to go off indefinitely!
' If else' is good for hours
'case' is good for setting range
Step 3: Snooze
I couldn't get snooze working for some time. It did turn lights off once pressed but would not turn them back on after delay.
I had forgotten that i was using latching buttons, so to turn the lights back on, the switch had to be returned to its original position; lights turned off, delayed and came back on. Big lesson on the types of hardware you use!
The snooze is not working with real time tho! i seem unable to have 2 working buttons with time!
Step 2: alarm to go off when hour and min is set, e.g. 7:30
Step 3: snooze
Step 1:To do this, i am using if statements with an anolog input.
The on / off button works by using this command:
// read the state of the set button value:
buttonSet = digitalRead(dayoff); // check if the dayoff button is pressed.
if (buttonSet == HIGH) { // if it has NOT been pressed, complete these steps
digitalWrite(ledgreen, HIGH); // turn green on:THIS IS TO ACT AS AN INDICACTOR!!
This still keeps time and can turn output off any time in code once pressed. This means my on / off button acts as setting the alarm and turning it off on signal. This is good as it means less buttons!!
Step 2: The tough part!
Changing the source; I've tried now, using LOTS of different codes to try and send the alarm signal to go off with an hour and min being specified.
The most affective so far is going back to my ' if else' statements.
if (hour == 8) {
digitalWrite(ledred, HIGH); // turn on red
This will reconise the hour, but using such commands as
if (hour ==8) { if (second ==10)} (seconds used as faster)
digitalWrite(ledred, HIGH); // turn on red
This sets the alarm to go off at 08:00:10 but at 08:00:11 it will come back on again...
if (hour ==8) { if (second >10)} (seconds used as faster)
digitalWrite(ledred, HIGH); // turn on red
This sets the alarm to go off at anything over 08:00:10 but it will come back on again at a new minute over 10 seconds 08:01:11...
I cannot get the alarm to go off indefinitely!
' If else' is good for hours
'case' is good for setting range
Step 3: Snooze
I couldn't get snooze working for some time. It did turn lights off once pressed but would not turn them back on after delay.
I had forgotten that i was using latching buttons, so to turn the lights back on, the switch had to be returned to its original position; lights turned off, delayed and came back on. Big lesson on the types of hardware you use!
The snooze is not working with real time tho! i seem unable to have 2 working buttons with time!
Sunday, 10 January 2010
Mood board
Friday, 8 January 2010
character cards
Thursday, 7 January 2010
Related Article
http://news.bbc.co.uk/1/hi/health/8435955.stm (02.01.10)
This adds rationale behind my project
This adds rationale behind my project
Tuesday, 5 January 2010
Buttons
My circuit design needs to be able to contain 3 buttons: one to activate the alarm, snooze and turn off like all basic alarm clocks. (I'm hoping to merge my alarm activation with my off button so fewer is needed.)
Before the holidays broke up, I found myself launching straight into combining a button into my real time clock. This was unsuccessful. A button you might think, and what i thought, would be relatively simple to add is not! When i added my button, it stopped my clock counter- so stopped my clock from working. This was bad! I need my clock to always be on regardless of external factors.
I decided that i would strip back to basics and build on the 'button' example provided by arduino without my real time clock. This could then be transferred back into my real time clock with a higher understanding of this particular set of codes.
This was actually relatively straight forward to do without using the clock, once of course i knew what to do;
Difficulty 1: planning what i would need and what i wanted to be the outcome. I drew myself a systems diagram to help break this down and order my actions. This would act like a guide for writing my code.


Before the holidays broke up, I found myself launching straight into combining a button into my real time clock. This was unsuccessful. A button you might think, and what i thought, would be relatively simple to add is not! When i added my button, it stopped my clock counter- so stopped my clock from working. This was bad! I need my clock to always be on regardless of external factors.
I decided that i would strip back to basics and build on the 'button' example provided by arduino without my real time clock. This could then be transferred back into my real time clock with a higher understanding of this particular set of codes.
This was actually relatively straight forward to do without using the clock, once of course i knew what to do;
Difficulty 1: planning what i would need and what i wanted to be the outcome. I drew myself a systems diagram to help break this down and order my actions. This would act like a guide for writing my code.


Difficulty 2: translating my systems diagram into Arduino code. The difficulty is to include all the loops. (I knew how to do one loop) This was a problem as i have 5 small loops in 1 big loop. I knew how i could complete this in 'P BASIC', a different programming software. As arduino is knew to me, i did not know what could or could not be manipulated. I did follow my P BASIC knowledge to overcome this. I found that i could use IF ELSE statements with lots of little loops in one big loops, solving my multiple loop crises!
Difficulty 3: Circuit building. I am just going to say it...i'm crap at making a working circuit! Just take a loop at this;

Difficulty 4: Testing.It took some time to realise that within my one big 'IF' statement with 5 smaller ones that i had added an extra '}' which closed my big loop and made 6 smaller loops...it now works hours later!!
My next step is start placing the button loops in my real time clock code.
Difficulty 3: Circuit building. I am just going to say it...i'm crap at making a working circuit! Just take a loop at this;
Difficulty 4: Testing.It took some time to realise that within my one big 'IF' statement with 5 smaller ones that i had added an extra '}' which closed my big loop and made 6 smaller loops...it now works hours later!!
My next step is start placing the button loops in my real time clock code.
Subscribe to:
Posts (Atom)




