-
Notifications
You must be signed in to change notification settings - Fork 2
Servo
Pablo García edited this page Apr 24, 2018
·
1 revision
Moves the shaft of the mini servo between 10º and 170º. On a continuous rotation servo, it moves in one direction and the opposite.
This example makes use of the ZUM Junior library.
- ZUM Junior Board
- Mini servo
#include <BQZUMJunior.h>
#include <BQZUMJuniorPorts.h>
#include <Servo.h>
//ZUM Junior Servo connedted to port 2. ATTENTION-> Servo is on wire 1.
const uint8_t pinServo = BQ::ZUMJunior::ports[2][1];
Servo servo;
void setup() {
// put your setup code here, to run once:
servo.attach(pinServo);
}
void loop() {
servo.write(10);
delay(1500);
servo.write(170);
delay(1500);
}