Coding an alarm system
Posted: Fri Mar 21, 2014 1:33 am
I've coded an alarm system by setting up a button which automatically clicks itself every second to check if the current time is equal to the time set by the user. It works perfectly fine running on my phone except I'm not sure if it takes day light savings into account....I've tested it by moving the time forward on my phone which doesn't affect the button (I can tell because the button also shows the current time at every second in a field ).....but when I move the time backward on my phone, the button stops clicking itself (I can tell because the time in the field stops changing). Is there a better way to code an alarm system which takes day light savings into account as well? Also I'd imagine if the button is clicking itself every second...that would drain the battery..so is there a more better way to code an alarm system? My code looks like this
button "Set"
on mouseUp
put the long time into field "time" (this part of the code is just for me to verify that the button is working properly)
if the long time = "hh:mm:ss am/pm" then
....(sends notification to phone)
end if
send "mouseUp" to button "Set" in 1 second
end mouseUp
Thanks
button "Set"
on mouseUp
put the long time into field "time" (this part of the code is just for me to verify that the button is working properly)
if the long time = "hh:mm:ss am/pm" then
....(sends notification to phone)
end if
send "mouseUp" to button "Set" in 1 second
end mouseUp
Thanks