<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Olimex: Sample Project A10S Android GPIOs for A10S-OLinuXino-MICRO SBC</title><link>https://community.element14.com/products/devtools/single-board-computers/w/documents/16614/olimex-sample-project-a10s-android-gpios-for-a10s-olinuxino-micro-sbc</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Olimex: Sample Project A10S Android GPIOs for A10S-OLinuXino-MICRO SBC</title><link>https://community.element14.com/products/devtools/single-board-computers/w/documents/16614/olimex-sample-project-a10s-android-gpios-for-a10s-olinuxino-micro-sbc</link><pubDate>Fri, 08 Oct 2021 07:41:24 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:06ac7357-36bd-4ea5-915a-f3aafb82af36</guid><dc:creator>atomar</dc:creator><comments>https://community.element14.com/products/devtools/single-board-computers/w/documents/16614/olimex-sample-project-a10s-android-gpios-for-a10s-olinuxino-micro-sbc#comments</comments><description>Current Revision posted to Documents by atomar on 10/8/2021 7:41:24 AM&lt;br /&gt;
&lt;p style="margin:0;"&gt;&lt;strong&gt;A10S GPIO under Android &lt;span style="color:#0000ff;"&gt;(Click &lt;a href="#https://www.element14.com/community/servlet/JiveServlet/download/64213-1-116422/ToogleLED.zip" class="migration-embeded-object"&gt;Here&lt;/a&gt; to Download)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;strong&gt;*) GPIO using ADB&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;1. Boot android (from NAND or SDcard)&lt;/p&gt;&lt;p style="margin:0;"&gt;2. Connect USB-to-Serial cable on UART1&lt;/p&gt;&lt;p style="margin:0;"&gt;3. Open terminal at speed 115200&lt;/p&gt;&lt;p style="margin:0;"&gt;4. When loading is ready in the terminal type &amp;quot;sh&amp;quot; and enter&lt;/p&gt;&lt;p style="margin:0;"&gt;5. &amp;quot;ls /sys/class/gpio_sw&amp;quot; will give you a list of all accessable GPIOs.&lt;/p&gt;&lt;p style="margin:0;"&gt;The GPIOs name is according to the chip ports. For example PE3 is LED1.&lt;/p&gt;&lt;p style="margin:0;"&gt;6. To set PE3 as output:&lt;/p&gt;&lt;p style="margin:0;padding-left:30px;"&gt;#echo 1 &amp;gt; /sys/class/gpio_sw/PE3/mul_sel&lt;/p&gt;&lt;p style="margin:0;padding-left:30px;"&gt;or as input&lt;/p&gt;&lt;p style="margin:0;padding-left:30px;"&gt;#echo 0 &amp;gt; /sys/class/gpio_sw/PE3/mul_sel &lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;7. To turn on LED:&lt;/p&gt;&lt;p style="margin:0;padding-left:30px;"&gt;&lt;span style="font-size:10pt;"&gt;#echo 1 &amp;gt; /sys/class/gpio_sw/PE3/data&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:30px;"&gt;and to turn off:&lt;/p&gt;&lt;p style="margin:0;padding-left:30px;"&gt;#echo 0 &amp;gt; /sys/class/gpio_sw/PE3/data &lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;8. If GPIO is as input to read state:&lt;/p&gt;&lt;p style="margin:0;padding-left:30px;"&gt;#cat /sys/class/gpio_sw/PE3/data&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;strong&gt;*) GPIO using Android SDK&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;Basicly you should read and write to the filesys. Make sure that your app is running as root, or else nothing will happen. The demo program toggle LED1 on every button press. All read/write methods are realized in GPIO.java file.&lt;/p&gt;
&lt;div class="migration-injected-attachments"&gt;&lt;div style="font-weight:bold;margin:15px 0 5px 0;"&gt;Attachments:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;table style="border:0;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="2"&gt;&lt;span class="_se_attachment" id="attid_https://www.element14.com/community/api/core/v3/attachments/116422"&gt;&lt;a href="https://community.element14.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-01-63/ToogleLED.zip"&gt;community.element14.com/.../ToogleLED.zip&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: olinuxino, a10s, cortex_a8, a10s-olinuxino-micro, arm, olimex&lt;/div&gt;
</description></item></channel></rss>