4 Replies Latest reply on Mar 19, 2015 3:19 PM by ForumMigrationAdmin

    MRAA on Galileo Gen 2 output

    ForumMigrationAdmin

      Hi,

      I'm using the IOTDK Eclipse IDE to compile a C program using the MRAA.  I'm trying to do a basic read to see if the Arduino pins are high or low, this program in particular looks at pin 8 and sends the output to stdout. I'm basing my program off of this:http://iotdk.intel.com/docs/master/mraa/gpio_8h.html

      #include <stdio.h>
      #include <string.h>
      #include <unistd.h>

      #include "mraa/gpio.h"

      int main(int argc, char **argv)
      {
          mraa_gpio_context gpio8;
          gpio8=mraa_gpio_init(8);
          mraa_gpio_dir(gpio8, MRAA_GPIO_IN);
          for (;;) {
              fprintf(stdout, "The value of pin 8 is: %d\n", gpio8);
              sleep(1);
          }

      I'm getting the following output:

      The value of pin 8 is: 143212968
      The value of pin 8 is: 143212968

      ... and so on. What does this integer mean, and how do I determine if this is high or low? Thanks!