To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1626
1625  |  1627
Subject: 
Re: Automatic switch
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sat, 13 Jan 2001 19:55:57 GMT
Viewed: 
1463 times
  
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 ! (24 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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR