Reading the User buttons (KEY1, KEY2, etc..)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reading the User buttons (KEY1, KEY2, etc..)

1,052 Views
blsousan
Contributor III

I have my iMX28EVK booting and mounting the rootfs from the host PC.  I found that I can control the LED's (LED2 and LED3 on the eval board) by writing the value of 0 - 255 to:

 

/sys/devices/platform/mxs-leds.0/leds/led-pwm0/brightness

 

So is there a similar file in the /sys directory where one can read the status of the user buttons?  Reading through the docs it looks like the user buttons are routed through LRADC1  (analog to digital converter) and will generate specific digital values that represent each button. 

 

Bills

Labels (1)
2 Replies

857 Views
blsousan
Contributor III

I found out how to read the buttons.  Simply read from the /dev/input/event0.  It generates a stream of data every time one of the buttons is pressed.

857 Views
andreass_
Contributor III

Hi Bill,

one question. How do you find out which button is pressed?
I see no differences between the different buttons.

Could you help me?

Thanks

0 Kudos
Reply