Skip to main content

Arduino... now what

Posted in

Okay I must be dumb. I have Arduino Uno, 2A motor controller shield and DFRobot keypad shield (LCD) I have install the Arduino software and download MStimer2 as well as the newest Open Moco timelapse engine....

Plug the shields all together, plug in USB and upload openmoco to it????

I just dont want to kill the thing if I do something wrong. Help would be greatly appreciated.

Thank you
George

George: The OMTLE doesn't

George:

The OMTLE doesn't work with the DFR keypad shield, it has no UI in the TLE (it's controlled via another device, say another arduino talking serial to it, or a computer running something like Slim).

Which 2A motor controller shield? I didn't think DFR made a stepper controller shield, just a DC motor shield?

The TLE is a full-featured engine with scripting capabilities. You're expected to hook it up to an isolated interface for a camera (see here for how to opto-isolate the control to your camera: http://openmoco.org/node/88) and at least one stepper driver that takes step/dir input.

Then, you can either write your own software to talk the TLE protocol (see the documentation link from the TLE software page), or use Slim to script out your shot sequence w/ the TLE. (It gives you a command to match every capability listed in the TLE documentation.)

!c

Thank you for taking time to

Thank you for taking time to help.

It is a DC motor shield...
I really want to to provide a way to control my .45 RPM dayton motor. I know a simple dc motor controller (PWM) could do that. But, using a dial would not be that consistent. I also would actually prefer continuous motion over shoot-move-shoot. My goal would be to at least have several predetermined speed settings, I would be able to select which speed via the keypad.

I do not really need the TLE to operate the camera shutter, just the motor.

I am not even sure I am using the arduino software correctly.

I have read the DIY pages on here, I have found how to install the apps on a Mac, but I am kinda lost from there... This is what I've done:
installed arduino
downloaded mstimer2
downloaded TLE
put 3 arduino boards together
connected them with USB to Mac
established the connection in Arduino software

Now I am not sure what to do....

George, OK, you can't use the

George,

OK, you can't use the OMTLE then - it won't work with your motor driver shield, and isn't made for DC motor driving, it's made for steppers. You should be looking at the DollyEngine instead, which is designed for controlling pwm-style DC motor drivers, and LCDs and buttons. It can be found here: http://openmoco.org/node/213

Now, you -will- have to make changes to the sketch to work with your hardware, you'll need to adjust the pin assignments, at a minimum, to match the motor shield and LCD shield you're using. Look at the main PDE file in the source code, adjust the pin assignments in the #define's at the top. Then, you should have a fully functional UI and everything using your existing hardware. This will provide the features you're looking for - that is, continuous motion w/ the dayton motor, a user interface using buttons and lcd, and more. Look here for very good docs on the dollyengine firmware: http://dynamicperception.com/?main_page=wordpress&page_id=67

!c

Great thanks for the help....

Great thanks for the help.... I downloaded all the files for the dollyshield..... I've opened the sketch in arduino. I am looking at the "Dollyshield" tab and see //motor PWM and pin assignments and // lcd pins with pin assignments. How do I find out what pins I need to make them?

Example:

#define LCD_RS 17

What is _RS and how do I figure out what pin it is?

This makes me feel so stupid.....

I was able to fine a pin

I was able to fine a pin allocation chart:
http://www.dfrobot.com/wiki/index.php?title=Arduino_LCD%26KeyPad_Shield_%28SKU:_DFR0009%29

I change the code to this on "dollyshield" sketch:
/* User Interface Values */

// lcd pins
#define LCD_RS 8
#define LCD_EN 9
#define LCD_D4 4
#define LCD_D5 5
#define LCD_D6 6
#define LCD_D7 7

// which input is our button
#define BUT_PIN 0

// lcd backlight pin
#define LCD_BKL 10

// max # of LCD characters (including newline)
#define MAX_LCD_STR 17

// how many buttons dow we have?
#define NUM_BUTTONS 5

// button return values

#define BUT0 1
#define BUT1 2
#define BUT2 4
#define BUT3 3
#define BUT4 0

// which buttons?
#define BUT_UP BUT0
#define BUT_DN BUT1
#define BUT_CT BUT2
#define BUT_LT BUT3
#define BUT_RT BUT4

Dos that all look close to right? After uploading to arduino, the DP screen comes up:
Off 1.0s [0]
R0.00i R0.00i

That's what it's supposed to

That's what it's supposed to show, so you got the LCD right at least =) You may have to adjust the values for each button, based on what the analogRead() values are for the DFRobot LCD shield...

See here, from the DFR page:

int  adc_key_val[5] ={30, 150, 360, 535, 760 };

Look for #define BUT0_VAL, etc. in the Dollyshield sketch, and make sure they match - you may have to experiment with which button is which relative to the DFR shield and what the DollyShield sketch expects each button to be. Notice that the DS sketch lets you define which button # corresponds to which interface button (#define BUT_UP, etc..)

However, you need to make the BUT_PIN 14 and not 0 -- analog 0 == digital 14, and the DS sketch expects you to provide the digital pin #, also make sure that your motor pins defined match the DFR motor shield pins, but so far so good =)

As for what the pins means, you'll find they are common terms with parallel LCDs, RS = read select, EN = enable, and so on. PWM = pulse width modulation (which pin drives pwm), the pins should be fairly close on the DS sketch b/c there are only so many PWM and analog pins. =)

!c

Okay I think I am making

Okay I think I am making progress. I am pretty confident that this is correct:

  // lcd pins
#define LCD_RS  8
#define LCD_EN  9
#define LCD_D4  4
#define LCD_D5  5
#define LCD_D6  6
#define LCD_D7  7

 // which input is our button
#define BUT_PIN 14

  // lcd backlight pin
#define LCD_BKL 10

  // max # of LCD characters (including newline)
#define MAX_LCD_STR 17

 // how many buttons dow we have?
#define NUM_BUTTONS 5

 // button return values

#define BUT0  0
#define BUT1  1
#define BUT2  2
#define BUT3  3
#define BUT4  4

  // which buttons?
#define BUT_UP BUT1
#define BUT_DN BUT2
#define BUT_CT BUT4
#define BUT_LT BUT3
#define BUT_RT BUT0

  // analog button read values
#define BUT0_VAL  30
#define BUT1_VAL  150
#define BUT2_VAL  360
#define BUT3_VAL  535
#define BUT4_VAL  760

  // button variance range
#define BUT_THRESH  60

Well, at least by following the sample code on that link. I don't nned the lines:

int adc_key_in = 0;
#define btnNONE 5

int  adc_key_val[5] ={30, 150, 360, 535, 760 };

I just need to put the VAL to the correct BUT# right?

With this I get a steady flicker on several (5) areas of the LCD
Off 1.0s [0]
R0.00i R0.00i

I guess that my button assignments are not right, following DFR they look right to me...

My DFR Reference:

// define some values used by the panel and buttons
int lcd_key     = 0;
int adc_key_in  = 0;
#define btnRIGHT  0
#define btnUP     1
#define btnDOWN   2
#define btnLEFT   3
#define btnSELECT 4
#define btnNONE   5

my dolyshield

 // button return values

#define BUT0  0
#define BUT1  1
#define BUT2  2
#define BUT3  3
#define BUT4  4

You need to leave BUT0-4 w/

You need to leave BUT0-4 w/ the values 1-5:

// button return values

#define BUT0  1
#define BUT1  2
#define BUT2  3
#define BUT3  4
#define BUT4  5

These codes refer to which button result maps to which button (1 = BUT0, 5 = BUT4). The function which uses these expects '0' to mean no button is pressed, these should be left as you found them.

You had the BUT0_VAL part right, but you have the center button as 0, which means that it triggers an "enter" press each time it checks and finds no button pressed. =)

!c

awesome... thank you so much!

awesome... thank you so much! I shifted the numbers up one and the app is running great.... Now onto the motor... I followed a similar guide for the pin numbers (no zeros) so fingers crossed. I will let you know how that goes... Also I am still reading the tutorials/guides for the dollyshield, figuring out the controls and calibration.

Again thank you for the support.

Do you know if I would need

Do you know if I would need to do anything special to install the camera 3.5mm jack?