![]() ![]() Open serial communications and wait for port to open: Int pos = 0 // variable to store the servo positionīyte mac = //subnet mask twelve servo objects can be created on most boards Servo myservo // create servo object to control a servo Connect a stepper motor with 200 steps per revolution (1.8 degree)Īdafruit_StepperMotor *myMotorStepper = AFMS.getStepper(200, 2) //Stepper use M3 & M4 Adafruit_DCMotor *myOtherMotor = AFMS.getMotor(2) You can also make another motor on port M2 In this case, M3Īdafruit_DCMotor *myMotor = AFMS.getMotor(1) //DC motor on M3 port Adafruit_MotorShield AFMS = Adafruit_MotorShield(0圆1) Or, create it with a different I2C address (say for stacking) Create the motor shield object with the default I2C addressĪdafruit_MotorShield AFMS = Adafruit_MotorShield() #include "utility/Adafruit_PWMServoDriver.h" Im using Arduino UNO, Arduino Ethernet shield & Adafruit motor shieldV2.3 on this project. Once i input all 3 types of codes together, it seem not working. But currently i had an issue that i'm only able to control 1 type a motor at a time. I'm currently working on a project which require me to control varies type of motor etc(Servo, Stepper & DC motor) via web browser. Hi Guys, i'm new to Arduino and require some advise on my project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |