Uno + Linksprite Motor Shield + Adafruit LCD = no power to the motor shield?


hi all

i'm in process of trying build controller camera slider pwered uno + linksprite motor shield , dc motor. have thing running fine trying add lcd , several preset options allow more felxibility when out , about. motor sketch works when set alone shield , uno. when link lcd in , upload unfinished should work sketch, there fwe led's not lighting on motor shield should be, think not getting power properly. connected follows:

top bottom:

motor shield - protoshield - uno - lcd connected detached via 5v, gnd , scl/sda.

the lcd works fine , button presses register should. now, led's on motor shield (when correctly working) lit follows: green v_logic led, red in1 (digital pin 8) , green in4 (digital pin 13) when connected lcd , below sketch uploaded,. lcd still works led on motor shield lit v_logic.

can maybe give ideas on resolving this?

code: [select]
// libraries adafruit rgb/lcd shield
#include <wire.h>
#include <adafruit_mcp23017.h>
#include <adafruit_rgblcdshield.h>

adafruit_rgblcdshield lcd = adafruit_rgblcdshield();
// these #defines make easy set backlight color
#define red 0x1
#define yellow 0x3
#define green 0x2
#define teal 0x6
#define blue 0x4
#define violet 0x5
#define white 0x7

#define button_shift button_select

// motor shield
//
//

int pini1=8;//define i1 interface
int pini2=11;//define i2 interface
int speedpina=9;//enable motor a
int pini3=12;//define i3 interface
int pini4=13;//define i4 interface
int speedpinb=10;//enable motor b
int rpm =250;//define speed of motor


// ************************************************
// setup , display initial screen
// ************************************************



void setup()
{
   serial.begin(9600);
 
  // initialize lcd display
 
   lcd.begin(16, 2);
   
   lcd.setbacklight(white);
   lcd.print(("iso 100"));
   lcd.setcursor(0, 1);
   lcd.print(("timelapse"));
   
   uint8_t i=0;   
 
  pinmode(pini1,output);
  pinmode(pini2,output);
  pinmode(speedpina,output);
  pinmode(pini3,output);
  pinmode(pini4,output);
  pinmode(speedpinb,output);   
}

void splash()
{
     analogwrite(speedpina,rpm);//input simulation value set speed
     analogwrite(speedpinb,rpm);
     digitalwrite(pini4,high);//turn dc motor b move clockwise
     digitalwrite(pini3,low);
     digitalwrite(pini2,low);//turn dc motor move clockwise
     digitalwrite(pini1,high);
}

void stopsplash()
{
     digitalwrite(speedpina,low);// unenable pin, stop motor. should done avoid damaging motor.
     digitalwrite(speedpinb,low);
     delay(0); // pause time of camera moving in milliseconds
}

void loopsplash()

{
  splash();
  delay(0); // time motor spins in milliseconds
   stop();
}

void preset_1()//main function

{
     analogwrite(speedpina,rpm);//input simulation value set speed
     analogwrite(speedpinb,rpm);
     digitalwrite(pini4,high);//turn dc motor b move clockwise
     digitalwrite(pini3,low);
     digitalwrite(pini2,low);//turn dc motor move clockwise
     digitalwrite(pini1,high);
}

void stop()
{
     digitalwrite(speedpina,low);// unenable pin, stop motor. should done avoid damaging motor.
     digitalwrite(speedpinb,low);
     delay(5000); // pause time of camera moving in milliseconds
}

void preset_1()//final loop
{
  preset_1();
  delay(175); // time motor spins in milliseconds
   stop();
}

void preset_2()
{
}

void preset_3()
{
}

void preset_4()
{
}

 

// ************************************************
// states state machine
// ************************************************
enum operatingstate {splash = 0, preset_1, preset_2, preset_3, preset_4};
operatingstate opstate = splash;


// ************************************************
// main control loop
//
// state changes pass through here
// ************************************************
void loop()
{
 
   uint8_t buttons = lcd.readbuttons();
   
     if (buttons) {
    lcd.clear();
    lcd.setcursor(0,0);
    if (buttons & button_up) {
      lcd.print("preset 1 ");
      lcd.setbacklight(white);
    }
    if (buttons & button_right) {
      lcd.print("preset 2 ");
      lcd.setbacklight(white);
    }
    if (buttons & button_down) {
      lcd.print("preset 3 ");
      lcd.setbacklight(white);
    }
    if (buttons & button_left) {
      lcd.print("preset 4 ");
      lcd.setbacklight(white);
    }
    if (buttons & button_select) {
      lcd.print("preset selected! ");
      lcd.setbacklight(white);
   
 
   switch (opstate)
   {     
   case splash:
      void splash();
      break;
   case preset_1:
      void preset_1();
      break;
    case preset_2:
      void preset_2();
      break;
   case preset_3:
      void preset_3();
      break;
   case preset_4:
      void preset_4 ();
      break;
   }
    }
     }
}

sounds have no motor power.

can confirm not trying share power between motor , logic?

can explain/diagram/photo setup (esp. power wiring) better?


Arduino Forum > Using Arduino > Motors, Mechanics, and Power (Moderator: fabioc84) > Uno + Linksprite Motor Shield + Adafruit LCD = no power to the motor shield?


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code