Demo entry 6749543

ar

   

Submitted by anonymous on Jun 13, 2018 at 10:04
Language: Arduino. Code size: 382 Bytes.

void mg995(int servonum,int startpulse,int aimpulse){
      if(aimpulse > startpulse){
        for (int pl = startpulse; pl < aimpulse ; pl=pl+2) {
        pwm.setPWM(servonum, 0, pl);
        }
      }
      else{
        for (int pl = startpulse; pl > aimpulse ; pl=pl-2) {
        pwm.setPWM(servonum, 0, pl);
        Serial.println(pl);
        }
      }
      
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).