Reference for Wiring version 0027+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name

powerEnable()

Examples
...

  // enable Analog Input section have power
  powerEnable(POWER_ADC);  
  
...

  // enable power in all sections/features 
  // of the microcontroller  
  powerEnable(ALL); 
  
...
Description The powerEnable() and powerDisable() methods enable and disable power to specific devices or sections of the Wiring hardware. By default power is enabled in all sections on the Wiring board. Note that the Wiring functionality regarding a specific section will stop by disabling power. These methods are useful to do efficient power management in conditions where power is very limited or has to be very efficient. The methods are provided for advanced users who know exactly what they are doing. Sections / features are encapsulated by constants as follow: POWER_ADC (analog input), POWER_SPI (SPI), POWER_WIRE (Wire), POWER_TIMER0 (Timer0, disbling this will stop all Wiring activity), POWER_TIMER1 (Timer1), POWER_TIMER2 (Timer2), POWER_TIMER3 (Timer3), POWER_TIMER4 (Timer 4), POWER_TIMER5 (Timer5), POWER_SERIAL0 (Serial), POWER_SERIAL1 (Serial1) and POWER_ALL (all the above). The power management functions provide a method to stop the clock to individual peripherals to reduce power consumption. Note: calling powerEnable() or powerDisable() commands has no effect on atmega128 microcontroller, this feature is only available for atmega1281 and atmega2561 microcontrollers.
Syntax
powerEnable(section)
Parameters
section constant: POWER_ADC, POWER_SPI, POWER_WIRE, POWER_TIMER0, POWER_TIMER1, POWER_TIMER2, POWER_TIMER3, POWER_TIMER4, POWER_TIMER5, POWER_SERIAL0, POWER_SERIAL1 or POWER_ALL
Returns None
Usage Application
Related powerDisable()
Updated on September 17, 2010 02:08:03pm PDT

Creative Commons License