User Manual
inti=0;
unsignedlongtime=0;
boolflag=HIGH;
voidsetup(){
//putyoursetupcodehere,torunonce:
Serial.begin(115200);
pinMode(10,OUTPUT);//PWMPIN10withwhiteline
pinMode(11,OUTPUT);//directioncontrolPIN11withblueline
}
voidloop(){
//putyourmaincodehere,torunrepeatedly:
if(millis()‐time>5000){
flag=!flag;
digitalWrite(10,flag);
time=millis();
}
if(Serial.available()){
analogWrite(11,Serial.parseInt());//inputspeed(mustbeint)
delay(200);
}
for(intj=0;j<8;j++){
i+=pulseIn(9,HIGH,500000);//SIGNALOUTPUTPIN9withwhiteline,cycle=2*i,1s=1000000us Signalcyclepulsenumber 27*2
}
i=i>>3;
Serial.print(111111/i);//speedr/min(60*1000000/(45*6*2*i))
Serial.println("r/min");
i=0;
}