Offline
Newbie
Karma: 0
Posts: 6
|
 |
« on: October 15, 2012, 06:58:37 pm » |
New to Arduino but not to MCUs or programming I assume the answer I am looking for is obvious but I could not find it online. Here it is: The pin used for motor control on the Romeo board (SKU:DFR0004) are assigned to the same pins used but the LCD+Key shield (SKU: DFR0009). I want to assign the motor control: #define motorDir 4 // INA motor pin #define motorSpeed 5 // PWM motor pin The LCD declaration is: LiquidCrystal lcd(8, 9, 4, 5, 6, 7); I am obviously missing something. help appreciated. Bob
|
|
|
|
|
Logged
|
|
|
|
|
France
Offline
God Member
Karma: 19
Posts: 613
Scientia potentia est.
|
 |
« Reply #1 on: October 15, 2012, 07:23:25 pm » |
Hello and welcome, If your 2 shields are using the same pins, I think there is no other solutions than: a) Using this thing: https://www.sparkfun.com/products/11002b) 1) Or manually re-routing the conflicting pins, by bending the pins on the above shield (LCD) so they don't plug on the shield below (the motor shield), and connect to other Arduino pins, using wires...And then change the line accordingly: LiquidCrystal lcd(8, 9, newpin1, newpin2, 6, 7); 2) Or if you don't want to bend pins, use lot of wires to connect the LCD like a breakout board rather than a shield. Maybe I'm wrong and there may be other methods, I'm beginner too. Hope it helps  PS: And don't forget that the motor 2 is using pin 6 and 7 too!
|
|
|
|
« Last Edit: October 15, 2012, 07:40:33 pm by guix »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #2 on: October 15, 2012, 11:20:43 pm » |
That's why I was hoping that i was missing something. I hoped not to get the tools out. only use/need one motor so I have a 2 pin problem. I will see if anyone has a better idea before I break out the wire cutters and I appreciate you help. cheers Bob
|
|
|
|
|
Logged
|
|
|
|
|
California
Offline
God Member
Karma: 13
Posts: 632
|
 |
« Reply #3 on: October 15, 2012, 11:36:45 pm » |
#define motorDir 4 // INA motor pin #define motorSpeed 5 // PWM motor pin Any reason the motors can not go to pins 2&3? #define motorDir 2 // INA motor pin #define motorSpeed 3 // PWM motor pin Just wondering. Is there a specific frequency you trying to get out of the pin 5 PWM?
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #4 on: October 16, 2012, 05:57:59 am » |
The pin used for motor control on the Romeo board (SKU:DFR0004) are assigned to the same pins used but the LCD+Key shield (SKU: DFR0009). Links are far more useful than text.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #5 on: October 16, 2012, 06:06:54 am » |
I'm not sure what the "links" comment meant.
Anyway, on further investigation it looks like the romeo has 4 jumpers which assign 4,5,6,7 tp the motor control so if I disconnect the offending pins and jump spare PWM pins as mentioned above I should be in business. I'll try and see.
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #6 on: October 16, 2012, 06:21:01 am » |
I'm not sure what the "links" comment meant. A URL. A hypertext device to allow clicking on some text, to be directed to the manufacturers web site, so we can see what you bought.
|
|
|
|
|
Logged
|
|
|
|
|
Espoo, Finland
Offline
God Member
Karma: 6
Posts: 581
"Oops, try again..."
|
 |
« Reply #7 on: October 16, 2012, 06:21:40 am » |
I think you can take out two jumpers (D4 and D5) and hardwire them to other digital pins. D4 is for direction control, so any digital pin will do, but for speed you need to pick any other free PWM capable pin. And you should also consider swapping D6 with some other PWM signal that is free and uses the same frequency divider as the other one, and change it to at least ...was 32kHz? You get quieter motor control under full speed, and more torque as well...? This seems to be newer version of Romeo than ours, older can't take shields. Links would be nice, but somehow I managed to find these parts... PaulS...  Cheers, Kari
|
|
|
|
|
Logged
|
The only law for me; Ohms Law: U=R*I P=U*I Note to self: "Damn! Why don't you just fix it!!!"
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #8 on: October 16, 2012, 07:13:00 am » |
PaulS, I appreciate the definitions and I apologize for not adding them to the post. I made an erroneous assumption that the boards I was using were well known and unique and that this board would be full of people using them and I expected a reply from someone who had the same setup, problem and solution. This too I will learn. Nothing like a little sarcasm to start the day.  Thanks for taking the time.
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #9 on: October 16, 2012, 07:21:29 am » |
Thanks for taking the time. No problem. Except that there are still no links. 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #10 on: October 16, 2012, 07:52:06 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Espoo, Finland
Offline
God Member
Karma: 6
Posts: 581
"Oops, try again..."
|
 |
« Reply #11 on: October 16, 2012, 10:31:56 am » |
bobsmithimages,
Did you read my post, and did you find the point I was trying to show? It is possible that I explained it a bit messy way, but it should work. All you need to do is to change pin assignments on your code. Works for me, should works for you as well.
I like Romeo, it includes many nice features for a start, as the first board, it just takes time to get use to its hardwired parts.
Cheers, Kari
|
|
|
|
|
Logged
|
The only law for me; Ohms Law: U=R*I P=U*I Note to self: "Damn! Why don't you just fix it!!!"
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #12 on: October 16, 2012, 02:24:11 pm » |
Kari, I did read it and I understood your point. It led me to conclude that you are right. All I have to do is remove the jumper that routs the pins 4,5 to the motor and jump 2,3 to replace them and assign these in the code. There are a set of header pins on the LCD board conveniently placed to make this easy. All working fine as "spcomputin" suggested with a slight jumper fix. Thanks y'all for the help.
|
|
|
|
|
Logged
|
|
|
|
|
|