PWR_BUT button usage

Started by Thomas, December 29, 2012, 05:32:35 PM

Previous topic - Next topic

Thomas

Well, here is a good question :

How to get the state (pressed/released) of a the PWR_BUT on A13 ?

I want to have a button to shutdown the board.
Basically (in shell/C/whatever language),

boolean pressed=false;
while(true)
{
pressed=GET_PWR_BUT_VALUE();

if(pressed==true)
{
   System("shutdown -h now");
}
}

Crenshinibon

Hi Thomas,

I'm trying to do the same. Any luck so far?

Regards
Dirk

JohnS

It looks like it will produce KEY_POWER

Have a look on the net for that and such as EV_KEY