Main Site Documentation

General ideas about algorithm


#1

I want to make an algorithm for a project and it will have to perform some tasks every 5 minutes during the day, let’s say during 7 and 19 o’clock. I will get the time from the RTC of the FEZ Spider. At night I want to put the system to sleep, perhaps hibernate, in order to save power. How do you suggest to do this? Do I have to use another thread, may be two? How do I put the system to sleep and how do I wake it up the next morning?

Thank you for your suggestions!


#2

@ Teodor17 - Must like you needing information for solving a problem, we need information to answer your question.

What mainboard are you using?

Hibernation and wakeup is fully supported in the Premium mainboards and libraries through the RealTimeClock and Power class. You use the Power class to go to sleep and get awaken by setting an alarm in real-time clock.

For the OSHW devices, which I do not have much experience with, there is no library support provided. But, with a bit of research, I am sure you could find how to control the processor through its registers.


#3

#4

ok, I have told you what classes you need to sleep and awake. check then documentation for the details


#5

Hibernating is covered here, in the Documents section: http://www.ghielectronics.com/docs/141/low-power Was working last time I tried.

Concerning periodic tasks, if you don’t need good precision, you may go with the Thread.Sleep() function. Otherwise System.Threading.Timer class is your friend.