5 Replies Latest reply on Jul 25, 2015 4:28 AM by Joel_Ulrich

    Blink a LED at startup

    marialand

      I own the Intel Edison with the Arduino break-out board. The blink a LED example (an Arduino sketch) works prefect.

       

      However, when I switch the Edison off and then back on again the LED doesn't blink anymore (like it would on a real Arduino).

       

      I would expect the current sketch to start automatically when the Edison starts up. What am I doing wrong?

        • 1. Re: Blink a LED at startup
          deium

          marialand

          I believe you have to copy your program to /sketch/sketch.elf with the executable flag set.

          • 2. Re: Blink a LED at startup
            deium

            Also, to reset the sketch area you can use these commands in a script with the executable set

            chmod 755 /sketch/sketch.elf

            chmod 755 /home/root/clear_sketch.sh

             

            ------ begin clear_sketch.sh -------------

            #!/bin/sh

            cp -f /tmp/log* /home/root

            mv -f /sketch/sketch.elf /sketch/sketch.elf.old

            rm /sketch/*

            sleep 5

            reboot

            ---- end clear_sketch.sh ----------

            • 3. Re: Blink a LED at startup
              mhahn

              how did you upload the sketch?

              • 4. Re: Blink a LED at startup
                marialand

                The sketch is already in that directory if you use the Edison Arduino EDI to upload it, but only the owner eXecute flag is set. I set "group" and "others" also to execute as per your instructions, and now this sketch runs when the Edison boots up. Perfect!!

                 

                You don't need to reset anything. Once the execute flags are set new sketches will over-write old ones but the execute flags remain. So you only need to do this once and from then on all sketches will automatically start when the Edison boots up. If you don't want it anymore simply remove the execute flags.

                 

                Thanks for your quick help!

                • 5. Re: Blink a LED at startup
                  Joel_Ulrich

                  Sorry guys to reply to this after almost 8 months. I recently got an edison board and I am having the same problem.

                   

                  Can you please explain exactly how to do this?

                  "I believe you have to copy your program to /sketch/sketch.elf with the executable flag set."

                   

                  Thanks in advance for your help.