Table of Contents

Stepper Motor

About this Article

Abstract

How to do this,please refer to light led and how to connect cubieboard and arduino

400 400

Schematics

400

Sorce Code

#include <Stepper.h>

#define STEPS 100

Stepper stepper(STEPS, 8, 9, 10, 11);

int previous = 0;

void setup()
{

  stepper.setSpeed(90);
}

void loop()
{
  int val = analogRead(0);


  stepper.step(val - previous);

  previous = val;
}

Headline

See Also