2021年6月22日 星期二

step motor

   int apin=8;

  int bpin=9;

  int cpin=10;

  int dpin=11;

  int delaytime=10;

void setup() {

  // put your setup code here, to run once:


    pinMode(apin,OUTPUT);

  pinMode(bpin,OUTPUT);

  pinMode(cpin,OUTPUT);

  pinMode(dpin,OUTPUT);

}


void loop() {

  // put your main code here, to run repeatedly:

digitalWrite(apin,HIGH);delay(delaytime);digitalWrite(apin,LOW);

digitalWrite(bpin,HIGH);delay(delaytime);digitalWrite(bpin,LOW);

digitalWrite(cpin,HIGH);delay(delaytime);digitalWrite(cpin,LOW);

digitalWrite(dpin,HIGH);delay(delaytime);digitalWrite(dpin,LOW);

}

沒有留言:

張貼留言

algorithm

 #include <iostream> #include <string.h> using namespace std; int main(int argc, char** argv)  { for(int j=2;j<=100;j++)//j...