GPIO via Android

Discussion in 'Android' started by m4the0, Feb 21, 2017.

  1. m4the0

    m4the0 New Member

    Joined:
    Feb 21, 2017
    Messages:
    8
    Likes Received:
    0
    How to control GPIO outputs via Android, i mean situation when i use android as my os of Udoo board ?
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    What board? What gpio pins, Android controlled or Arduino controlled?
     
  3. m4the0

    m4the0 New Member

    Joined:
    Feb 21, 2017
    Messages:
    8
    Likes Received:
    0
  4. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
  5. m4the0

    m4the0 New Member

    Joined:
    Feb 21, 2017
    Messages:
    8
    Likes Received:
    0
    At sites you posted there is only description how to acces GPIO from Linux.
    Could i do the same via android terminal ? Im not android developer, so is there posibility to acces GPIO from android app code ?
     
  6. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Core of android is Linux, hence you can access GPIO, I2C, etc from sysfs (/sys/class/gpio/). Now, that you have access to sysfs and underlines buses, you can implement applications as you like:

    -script in python, etc
    -native driver as part of linux kernel
    -use NDK to write library for your APP.
     
  7. m4the0

    m4the0 New Member

    Joined:
    Feb 21, 2017
    Messages:
    8
    Likes Received:
    0
  8. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    The Udoo Dual ( and all other Udoos) has 2 sets of gpio: 1 set controlled by the OS (Linux, Android) processor and 1 set controlled by a special Arduino processor. This set is meant for real time, high speed gpio processing not influenced by the load of the main processor.

    For controlling some LEDs gpio controlled by the main processor is good enough. For other applications like controlling and monitoring large amounts of LEDs, sensors, actuators, motors you need a processor that is designed for this. And an Arduino is.
    That is why I asked this questions to you before. The video from Udoo is about controlling Gpio by Arduino and have the 2 processors communicate with each other.
     
  9. m4the0

    m4the0 New Member

    Joined:
    Feb 21, 2017
    Messages:
    8
    Likes Received:
    0
    Ok, thank you a lot for help !
     

Share This Page