First page Back Continue Last page Overview Graphics
What if devices could communicate?
and a little code:
if(time_now($Wake_Up – 0:20) && $Alarm_OK) {
$CoffeePot->set(ON);
}
if(time_now($Wake_Up) && $Alarm_OK) {
$AlarmClock->ramp(GENTLE);
$AlarmClock->set(ON);
}
Notes:
How about some example Misterhouse code?
- 1st if = turn on the Coffee Pot if the Alarm has been set and it's 20 minute before wake up time
- 2nd if = if it's time to wake up and the laram has been set gently ramp up the radio to wake me up
- The missing code is the 'device drivers for the devices (Object oriented drivers) and the code that handles getting the setting from the alarm clock.