SHARE
TWEET

Untitled

a guest Jul 19th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top