0. ÁÖ¹®¹øÈ£:
1. Á¦Ç° À̸§: 12303]ZAS-KIT-001
2. Á¦Ç° ¸µÅ©:
4. ¹®ÀÇ ³»¿ë: ¾ÆµÎÀ̳ë ÇÁ·Î±×·¥ ¸ðÅÍ Á¤¿ªÈ¸Àü
´ÙÀ½ ÇÁ·Î±×·¥ÀÌ Á¤¿ªÈ¸ÀüÀÌ ¾ÈµË´Ï´Ù.
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
const int cw = 8;
const int ccw = 9;
Stepper myStepper(200,5,5);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(10);
// initialize the serial port:
Serial.begin(9600);
pinMode (cw, INPUT_PULLUP);
pinMode (ccw, INPUT_PULLUP);
}
void loop() {
// step one revolution in one direction:
if (!digitalRead(cw)) Stepper.step(200);
if (!digitalRead(ccw)) Stepper.step(-200);
}