Android LL GPIO export automatically at startup

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

Android LL GPIO export automatically at startup

1,783 Views
kamilbystryk
Contributor III

How can I set automatically export and change direction of GPIO at start Android (5.0.2). I want to avoid the need to manual entering:

echo 140 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio140/direction

commands in root console.

Labels (2)
0 Kudos
2 Replies

957 Views
kamilbystryk
Contributor III

Problem solved - by mistake I put code in wrong section of init.rc:

write /sys/class/gpio/export 142

write /sys/class/gpio/gpio142/direction out

chmod 777 /sys/class/gpio/gpio142/value

0 Kudos

957 Views
jerry2
Contributor II

Hello,

In which section did you insert these commands in the init.rc?

on boot?

0 Kudos