adafruit v2 motor shield dc motor with hall sensors help needed please


hi
i need latest project.
my goal drive gear box x amount of times x been 1800 revolutions @ time.
i have found encoder library works fine problem when try control motor nothing happens either serial print or motor code follows

thanks in advance



#include <encoder.h>
#include <afmotor.h>
af_dcmotor motor(4);
int dp;
// change these 2 numbers pins connected encoder.
//   best performance: both pins have interrupt capability
//   performance: first pin has interrupt capability
//   low performance:  neither pin has interrupt capability
encoder myenc(2, 3);
//   avoid using pins leds attached

void setup() {
 serial.begin(9600);
 serial.println("basic encoder test:");
 
}


long oldposition  = -999;

void loop() {
 long newposition = myenc.read();
 if (newposition != oldposition) {
   oldposition = newposition;
   serial.println(newposition);
   motor.setspeed(200);
 motor.run(forward);
   while (newposition<=1800);
   motor.run(release);
 }
}

what motor have? , how motor shield powered?


Arduino Forum > Using Arduino > Motors, Mechanics, and Power (Moderator: fabioc84) > adafruit v2 motor shield dc motor with hall sensors help needed please


arduino

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support