|    |  
      In lugnet.robotics.rcx.legos, Fabien Bergeret writes: 
> Is there any API for switching off the rcx, either immediately or after a 
> givent period of inactivity (i.e a watchdog) ? (already used many batteries 
> by forgetting to switch it off...). 
 
0.2.5 includes the idle timeout code.  After 15 minutes of no activity (program 
isn't running, no buttons pushed) it will turn itself off.  I added this 
feature when I woke up to discover I left the RCX on overnight for the third 
time. 
 
You can force the RCX to turn off from inside a program by adding this: 
 
  #include <sys/timeout.h> 
 
// somewhere in your code: 
 
   idle_powerdown = 1; 
 
I haven't checked for side effects of doing this in a program, however.  It 
might leave the kernel in an indeterminant state, so use with caution. 
 
Rossz 
 |  
       |  
           
   
        Message is in Reply To:
             |    | Automatic switch
  |  
  |  Is there any API for switching off the rcx, either immediately or after a givent period of inactivity (i.e a watchdog) ? (already used many batteries by forgetting to switch it off...). Thanx !    (25 years ago, 13-Jan-01, to lugnet.robotics.rcx.legos)   
   |         
      3 Messages in This Thread:     
     
 
      - Entire Thread on One Page:
      
        
- Nested: 
        All | Brief | Compact | Dots
        
 Linear: 
        All | Brief | Compact
           
         | 
        
  | 
      
 
   | 
           |