2 Replies Latest reply on May 19, 2015 6:42 AM by Paul Bearne

    MCU Program - blink

    Stan_Gifford

      I have taken the example program for the MCU and modified it slightly to blink the onboard LED attached to (arduino) pin 13 - gpio 40

       

      Here is the program

       

      #include "mcu_api.h"

      #include "mcu_errno.h"

      /*

      * This program will blink GPIO 40, which connects to Edison Arduino board DIG 13

      */

      void mcu_main()

      {

          /* your configuration code starts here */

          gpio_setup(40, 1);  /* set GPIO 40 as output */

          while (1)

          {

              gpio_write(40, 1);

              mcu_sleep(100);         /* sleep 1 second */

              gpio_write(40, 0);

              mcu_sleep(100);

          }

      }

       

      I have compiled and downloaded the prog - then reset/reboot the arduino edison - unfortunately no blinky blinky.

       

      I suspect I have done something stupendously dumb but I cannot see it!

       

      If anyone can advise or assist I would be extremely grateful.

       

      Stan

        • 1. Re: MCU Program - blink
          Stan_Gifford

          Just thought I would play again.

           

          Added a couple of debug statements - and now it works (after issuing the ./init_DIG.sh -o 13 -d output command)

           

          Not getting any debug stuff out (filtering for Info level)

           

          #include "mcu_api.h"

          #include "mcu_errno.h"

          /*

          * This program will blink GPIO 40, which connects to Edison Arduino board DIG 7

          */

          void mcu_main()

          {

              /* your configuration code starts here */

              gpio_setup(40, 1);  /* set GPIO 40 as output */

              while (1)

              {

                  gpio_write(40, 1);

                  debug_print(DBG_INFO, "LED On\n");

                  mcu_sleep(100);         /* sleep 1 second */

                  gpio_write(40, 0);

                  debug_print(DBG_INFO, "LED Off\n");

                  mcu_sleep(100);

              }

          }

          • 2. Re: MCU Program - blink
            Paul Bearne

            theres a section in this document

            https://software.intel.com/en-us/node/557354 towards the bottom of the page getting debug messages from the mcu which worked for me so may help you