c_cpp basic_motor_controll.ino

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp basic_motor_controll.ino相关的知识,希望对你有一定的参考价值。

/*
  Motor
  turning a motor clock then counter clock wise

  This example is part of the Fritzing Creator Kit: www.fritzing.org/creatorkit.
*/

int motor_turn_this_way=11;                    // motor direction one Pin
int motor_turn_that_way=10;                    // motor direction two Pin
int motor_speed=9;                // speed Pin

void setup(){
  pinMode(motor_turn_this_way,OUTPUT);        // pin A declared as OUTPUT
  pinMode(motor_turn_that_way,OUTPUT);        // pin B declared as OUTPUT
  pinMode(motor_speed, OUTPUT);

  digitalWrite(motor_turn_this_way,HIGH);     // motor direction one pin switched to HIGH (+5V)
  digitalWrite(motor_turn_that_way,LOW);      // motor direction two pin switched to LOW  (GND)
}

void loop(){
  /*0 - 255*/
  analogWrite(motor_speed, 100 );

  delay(1000);

  analogWrite(motor_speed, 0);

  delay(5000);
}

以上是关于c_cpp basic_motor_controll.ino的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp 200.岛屿数量

c_cpp 127.单词阶梯

c_cpp MOFSET

c_cpp MOFSET

c_cpp 31.下一个排列

c_cpp string→char *