element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
RIoTboard
  • Products
  • Dev Tools
  • Single-Board Computers
  • RIoTboard
  • More
  • Cancel
RIoTboard
Forum Create Android app that utilizes GPIO
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join RIoTboard to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 6 replies
  • Subscribers 26 subscribers
  • Views 1375 views
  • Users 0 members are here
  • android
  • tutorial
  • gpio
  • riotboard
  • newbee
Related

Create Android app that utilizes GPIO

toonamo
toonamo over 11 years ago

Hello,

 

I have been trying to find more info on how to access the gpio from inside a android app. Something simple like blinking and/ or fading an led. I want to eventually use the gpio and a few mosfets to be able to control my extra lighting in my vehicle. I found some info for other boards that have android and a form of gpio but could only find info on linux for the riotboard. I would prefer to use android as a car computer that happens to be able to control lighting. I didn't want to get too complicated with it (use zigbee or bluetooth to send commands to arduino in order to trigger mosfets).

 

I promise that I attempted to google this already. If anyone has or knows of where i can find more information i would greatly appreciate it. Even if it doesn't have much to do with the exact mission i have. There seems to be a lack of tutorials on the riotboard and android.

  • Sign in to reply
  • Cancel

Top Replies

  • toonamo
    toonamo over 11 years ago in reply to Former Member +1
    I liked the idea of using the riot board as a in-car computer that could also interface directly with a few items. I wanted to avoid the need of a arduino. I only mentioned it because the arduino comes…
  • radiatortwo
    radiatortwo over 11 years ago

    If you only want to Turn GPIO ports on and off it should be as simple as writing a file.

     

    In the shell the command "echo 1 > /sys/class/leds/user_led/brightness" would turn the GPIO port for the user led on.

    And "echo 0 > /sys/class/leds/user_led/brightness" turns it off.

     

    So you just need to find a method to write to that file.

    (I´m no Android developer so I can´t tell you how to this in java.)

     

    What I don´t know is if you have permissions to write to the GPIO ports out of the box.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • tusharp
    tusharp over 11 years ago

    plz check this thread also.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • kylemills
    kylemills over 11 years ago

    check this link ; http://android.serverbox.ch/?p=972

    they got android app using GPIO on imx6 image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago

    If you want to reduce the complexity of your project, since you are already planning on using the arduino as the actual controller (triggering the mosfets), you could probably bypass the riotboard altogether, and use the arduino with a wifi or bluetooth shield, etc.  You could either write a cell-phone/ipod app to send the commands wirelessly to the arduino, or have the arduino serve a small web page that allows you to turn things on/off using a web form with buttons.  There are plenty of projects and tutorials you could find using that method.  Are you planning on using the riotboard for any particular reason?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • toonamo
    toonamo over 11 years ago in reply to Former Member

    I liked the idea of using the riot board as a in-car computer that could also interface directly with a few items. I wanted to avoid the need of a arduino. I only mentioned it because the arduino comes with 5v logic and is so commonly used that there are plenty of tutorials. if i could do everything with the riotboard that would have been the way for me to go. I am learning how to develop apps for android right now and trying to work my way up controlling on-board devices. With the riotboard being a dev board with gpio i just wanted to know how to acctually control the gpio. Being that android was designed for phones and tablets i didn't know how to go about accomplishing that.

     

    So far i the riotboard is a great product and there was enough info to get me started with learning. For instance how to root the device and also add google services (even though i can't get either to work as described). I am new to the android scene so i have a ways to go.

     

    Thanks for all the links. I am going to play with those and if i get it working i will report back here.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to toonamo

    Hello all!

    We want to setup the external gpio on RIOTBOARD and we get stuck with mux procedure. We want to use all GPIO from J13 connector.

    EX:

     

    This is the only GPIO  that works:


    root@RIoTboard_6solo:/ # devmem2 0x20E009C w 0x5

    /dev/mem opened.

    Memory mapped at address 0x400fc000.

    Value at address 0x20E009C (0x400fc09c): 0x5

    Written 0x5; readback 0x5

    root@RIoTboard_6solo:/ # echo 112 > /sys/class/gpio/export

    1|root@RIoTboard_6solo:/ # echo out > /sys/class/gpio/gpio112/direction

    root@RIoTboard_6solo:/ # echo 1 > /sys/class/gpio/gpio112/value


    And the rest of them doesn't work

    Ex:

    We try to set GPIO5_08 to output (that means SW_PAD_CTL_PAD_DISP0_DATA14)

    root@RIoTboard_6solo:/ # devmem2 0x20E03DC w 0x5

    /dev/mem opened.

    Memory mapped at address 0x40180000.

    Value at address 0x20E03DC (0x401803dc): 0x1

    Written 0x5; readback 0x1

    --->All time  we get 0x1 even we write 0x5 (ALT5 -MUX mode)

     

    The problem:

    We can't set the GPIO as output or input. Maybe we need to set somehow the SION first?

    Any idea?

     

    Thx in advance!

     

    http://www.element14.com/community/thread/42644/l/gpio-ports-on-j13-connector

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube