Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #ifndef __DCMOTOR_H
  2. #define __DCMOTOR_H
  3. #include <Adafruit_MotorShield.h>
  4. #include "utility/Adafruit_MS_PWMServoDriver.h"
  5.  
  6. //Create the motor shield object with the default I2C address
  7. Adafruit_MotorShield AFMS = Adafruit_MotorShield();
  8.  
  9. // Select which 'port' M1, M2, M3 or M4. In this case, M1
  10. Adafruit_DCMotor *myMotor = AFMS.getMotor(4);
  11.  
  12. void motor_shield_setup() {
  13. AFMS.begin(); // create with the default frequency 1.6KHz
  14. //AFMS.begin(1000); // OR with a different frequency, say 1KHz
  15. }
  16.  
  17. #endif //__DCMOTOR_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement