Hi Jesus,

The GPIO pins on the Turbot are functional, so I am surprised you are having 
such issues.

One thing that comes to mind is that the MRAA libraries are expecting to have 
root privileges, so make sure you either execute you program with a ‘sudo’ 
context ( as in, if your program is called ‘test_gpio’, you execute ‘sudo 
test_gpio’ to elevate the program to run with root permissions), or log in as 
root.

You can also examine the syslog messages to see what MRAA is reporting –certain 
MRAA error conditions logged there. For instance on Ubuntu ‘cat 
/var/log/syslog’ to see the whole log.

Hope that helps,
|\/|ark

From: elinux-MinnowBoard [mailto:[email protected]] 
On Behalf Of Jesus Velazquez
Sent: Thursday, July 6, 2017 2:51 PM
To: MinnowBoard Community Email List <[email protected]>
Subject: Re: [MinnowBoard] GPIO doesn't working as Input

Hi Van,

I have Ubuntu 16.04 with kernel version:

Linux blackbox 4.4.0-81-generic #104-Ubuntu SMP Wed Jun 14 08:17:06 UTC 2017 
x86_64 x86_64 x86_64 GNU/Linux

And I has have test with Pulsar Linux 7 with kernel 3.18.x

My libraries that I use is MRAA Version: v1.7.0-44-gbd3d9d8 ( 
https://iotdk.intel.com/docs/master/mraa/ )

I have tried with Pins 26, 25, 21, 20 and 14.

This is my code:

---

#include "mraa/gpio.h"



int main(){

   /* initialize MRAA */

   mraa_init();



   /* create an MRAA digital context */

   mraa_gpio_context m_gpio = NULL;



   /* initialize D2 for use as a digital pin */

   m_gpio = mraa_gpio_init(26);



   /* configure the digital pin as an input */

   mraa_gpio_dir(m_gpio, MRAA_GPIO_IN);

   /* Set Gpio input mode */

   mraa_gpio_input_mode(m_gpio, MRAA_GPIO_ACTIVE_LOW);



   /* read the value into an integer */

   int value = mraa_gpio_read(m_gpio);



   /* print the value */

   if (value != 0)

      printf("The button is being pushed %d\n", value);

   else

     printf("The button is not being pushed %d\n", value);



   /* now release (close) the pin and exit */

   mraa_gpio_close(m_gpio);

   return(0);

}



---
Thank you for your help

Jesus V



2017-07-06 14:42 GMT-05:00 Van Der Pol, MarkX 
<[email protected]<mailto:[email protected]>>:
Hi Jesus,
Welcome to the list.

Please let me know the OS and libraries you are using to access the GPIO pin in 
question, and what program you use to test the GPIO state.

And is it specifically GPIO 26, or are all GPIO’s behaving this way?

Thanks,
|\/|ark

From: elinux-MinnowBoard 
[mailto:[email protected]<mailto:[email protected]>]
 On Behalf Of Jesus Velazquez
Sent: Wednesday, July 5, 2017 9:14 AM
To: 
[email protected]<mailto:[email protected]>
Subject: [MinnowBoard] GPIO doesn't working as Input

Hello list,

This is my first post in this list and I'm happy for join me to it.

I have a Minnowboard Turbot and I would like to manage a GPIO as input but I 
can see that my pin (26 for example) always is in HIGH state and the 
interruption never is active.

If I use the GPIO as output, it works fine and can change the state, but as 
Input not.

Somebody have the same experience? or can resolve this issue?

Thanks in advance.



_______________________________________________
elinux-MinnowBoard mailing list
[email protected]<mailto:[email protected]>
http://lists.elinux.org/mailman/listinfo/elinux-minnowboard

_______________________________________________
elinux-MinnowBoard mailing list
[email protected]
http://lists.elinux.org/mailman/listinfo/elinux-minnowboard

Reply via email to