9 Replies Latest reply on Nov 3, 2015 4:10 PM by annu_shah

    converting arduino ide code to cpp code to run on linux (intel galileo gen 2 yocto)

    annu_shah

      hi,

       

      can you guide me how to convert a code on arduino ide to cpp so that i could run it on linux;-

       

      this is the code that i am trying to convert :-

       

      #include <Servo.h>

       

       

      Servo myservoM;  // create servo object to control a servo

       

       

       

       

      void setup()

      {

        myservoM.attach(9);  // attaches the servo on pin 9 to the servo object

        Serial.begin(9600);

      }

       

       

      void loop()

      {

        Serial.println("start");

        for(int k=10;k>0;k--){

          Serial.println(k);

          delay(1000);

        }

         

        for (int j=88;j<92;j++){

          myservoM.write(j);

          Serial.println(j);

          delay(2500);

        }

        Serial.println("Start Turning");

        for (int i=0;i<255;i++){

         

               // scale it to use it with the servo (value between 0 and 180)

          myservoM.write(i);                  // sets the servo position according to the scaled value

          Serial.println(i);

          delay(250);

        }   // waits for the servo to get there

      }

       

       

      thanks alot this community has been so helpful to me.