Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __DCMOTOR_H
- #define __DCMOTOR_H
- #include <Adafruit_MotorShield.h>
- #include "utility/Adafruit_MS_PWMServoDriver.h"
- //Create the motor shield object with the default I2C address
- Adafruit_MotorShield AFMS = Adafruit_MotorShield();
- // Select which 'port' M1, M2, M3 or M4. In this case, M1
- Adafruit_DCMotor *myMotor = AFMS.getMotor(4);
- void motor_shield_setup() {
- AFMS.begin(); // create with the default frequency 1.6KHz
- //AFMS.begin(1000); // OR with a different frequency, say 1KHz
- }
- #endif //__DCMOTOR_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement