usag1e / Homza

1 stars 0 forks source link

Create a function that transforms a time into ratio #4

Closed ilyasst closed 9 years ago

ilyasst commented 9 years ago

This function would input a datetime, example 2015-02-08-11-05-00, calculate the difference between now ( 2015-02-08-11-38-00 ), which gives here 33 minutes.

Then use a reference time, that will be here chosen as an example 2 hours, to determine the presence time ratio = 33minutes / 2hours, which should be between 0 an 1.

This parameter will be used to make the LED blink. If it is not clear, please answer this comment as soon as possible

YahyaAbderrafai commented 9 years ago

Crushed