title: Need "hello world" for writing to Intel Edison gpio in C
body: <p>I need a simple program that will write to gpio.  I can't find one anywhere.  The example in the mmra documentation does not work. I picked gpio14 because the Sprakfun example that writes to this pin using system calls works just fine.  But my program does not work.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;mraa.h&gt;
  #include &lt;math.h&gt;
  #include &lt;mraa/gpio.h&gt;
  
  int main(int argc, char **argv)
  {
  
  mraa_gpio_context gpio;
  
  gpio = mraa_gpio_init(14);  &lt;--- to get gpio14 to toggle change this to 36
  mraa_gpio_dir(gpio, MRAA_GPIO_OUT);
  int value = 0;
  for (;;) {
      if(value == 0)value = 1;
      else value = 0;
      mraa_gpio_write(gpio,value);
      printf("output is %d\n",value);
      sleep(1);
  }
  mraa_gpio_close(gpio);
  return 0;
  }
  </code></pre>
  
  <p>The loop runs and prints out output is 1 then output is 0. I have an oscilloscope on the pin and it stays low.</p>
  
  <p>Using <a href="https://learn.sparkfun.com/tutorials/sparkfun-blocks-for-intel-edison---gpio-block" rel="nofollow">this Sparkfun</a> tutorial I can move the pin high so I know my setup is correct.  If someone can just give me an example of code that works with all the includes and such that would be very helpful.</p>