1 Reply Latest reply on May 15, 2014 11:59 AM by JPMontero_Intel

    Controlling stepper motors using intel galileo

    Mashilekhutso27

      Hi Guys

       

      i am struggling to run my stepper motors on the intel galileo as they work perfect on the arduino uno , so i am thinking maybe I am missing something fundamental and below is a simple code I use to test the bipolar stepper motor connected to a sparkfun easy driver then into the intel galileo board.

       

      int Distance = 0;  // Record the number of steps we've taken

      void setup() {               

        pinMode(8, OUTPUT);    

        pinMode(9, OUTPUT);

        digitalWrite(8, LOW);

        digitalWrite(9, LOW);

      }

      void loop() {

       

       

        digitalWrite(9, HIGH);

        delayMicroseconds(100);         

        digitalWrite(9, LOW);

        delayMicroseconds(100);

        Distance = Distance + 1;   // record this step

       

        // Check to see if we are at the end of our move

        if (Distance == 3600)

        {

          // We are! Reverse direction (invert DIR signal)

          if (digitalRead(8) == LOW)

          {

            digitalWrite(8, HIGH);

          }

          else

          {

            digitalWrite(8, LOW);

          }

          // Reset our distance back to zero since we're

          // starting a new move

          Distance = 0;

          // Now pause for half a second

          delay(500);

        }

      }

       

      Please advise on how to make it work on the intel galileo