Hi I am having issues setting up an arduino motor shield in conjunction with an arduino uno R3. I suspect I have some wrong pin assignments, but havent worked it out and couldn't find any help for it. I have attached my very simple program can someone please point me in the right direction.
Pete
running a DC motor using the arduino motor shield
-
- Posts: 33
- http://meble-kuchenne.info.pl
- Joined: Sat Nov 20, 2021 11:28 am
- Has thanked: 1 time
running a DC motor using the arduino motor shield
- Attachments
-
- DC motor.fcfx
- (9.53 KiB) Downloaded 539 times
-
- Matrix Staff
- Posts: 1921
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 623 times
- Been thanked: 645 times
Re: running a DC motor using the arduino motor shield
Hello.
The pins look wrong as they should not be mapping on the Arduino.
I have created a temporary fix.
Browse to this location using file explorer, it's hidden by default so just paste the link into your address bar.
C:\ProgramData\MatrixTSL\FlowcodeV9\Components
Replace the existing file with the attached file.
The flowchart will need to be refreshed if Flowcode was open when you replaced the file.
It looks like the connections are:
Sorry I only have a motor shield to test with.
The pins look wrong as they should not be mapping on the Arduino.
I have created a temporary fix.
Browse to this location using file explorer, it's hidden by default so just paste the link into your address bar.
C:\ProgramData\MatrixTSL\FlowcodeV9\Components
Replace the existing file with the attached file.
The flowchart will need to be refreshed if Flowcode was open when you replaced the file.
It looks like the connections are:
Code: Select all
Function Channel A Channel B
Direction Digital 12 Digital 13
Speed (PWM) Digital 3 Digital 11
- Attachments
-
- motor_reversible.fcpx
- (51.73 KiB) Downloaded 516 times
Martin
-
- Posts: 33
- Joined: Sat Nov 20, 2021 11:28 am
- Has thanked: 1 time
Re: running a DC motor using the arduino motor shield
Thanks for the quick response Martin. I assume once I install the file, as I have I just need to program the arduino with the file I put on the posting. If so its still not working.
-
- Matrix Staff
- Posts: 1921
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 623 times
- Been thanked: 645 times
Re: running a DC motor using the arduino motor shield
Did you reload the flowchart after?
If you are using channel A have you got Channel 6 selected?
If so, what does it show for port?
Is the Remap Pin greyed out?
Have you got Direction Pin set to either $D12 with Use Chip References unticked, or B4 with it ticked?
If still not working, I will look into it more tomorrow.
If you are using channel A have you got Channel 6 selected?
If so, what does it show for port?
Is the Remap Pin greyed out?
Have you got Direction Pin set to either $D12 with Use Chip References unticked, or B4 with it ticked?
If still not working, I will look into it more tomorrow.
Martin
-
- Posts: 33
- Joined: Sat Nov 20, 2021 11:28 am
- Has thanked: 1 time
Re: running a DC motor using the arduino motor shield
Hi Martin
I have A connected, channel6 selected, Port shows as $PORTD.3 but is greyed out and the direction pin is $PORTB.4
I have 250 for speed 300 for acceleration and 50 for deceleration
unfortunately it is still not working
Pete
I have A connected, channel6 selected, Port shows as $PORTD.3 but is greyed out and the direction pin is $PORTB.4
I have 250 for speed 300 for acceleration and 50 for deceleration
unfortunately it is still not working
Pete
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: running a DC motor using the arduino motor shield
Hi
I've only recently started playing with an Uno, mainly to explore Flowcode Developer, so I'm no expert with it.
Keen to play I downloaded your chart (and Martin's component). Whilst I don't have the motor shield I can monitor the pins with a logic analyser. No matter what I tried I couldn't get a PWM output on any channel (1-6). I could see enable and direction pins change state where applicable as I tried various scenarios, but no actual PWM.
Regards
I've only recently started playing with an Uno, mainly to explore Flowcode Developer, so I'm no expert with it.
Keen to play I downloaded your chart (and Martin's component). Whilst I don't have the motor shield I can monitor the pins with a logic analyser. No matter what I tried I couldn't get a PWM output on any channel (1-6). I could see enable and direction pins change state where applicable as I tried various scenarios, but no actual PWM.
Regards
-
- Matrix Staff
- Posts: 1921
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 623 times
- Been thanked: 645 times
Re: running a DC motor using the arduino motor shield
Hello.
The motor component has now been updated and should be available via Library updates.
Thank you for your patience.
The motor component has now been updated and should be available via Library updates.
Thank you for your patience.
Martin
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: running a DC motor using the arduino motor shield
Thanks Martin
I'll try it out later today.
Regards
I'll try it out later today.
Regards
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: running a DC motor using the arduino motor shield
Hi
Working now sort of....
With Duty set to 128 I get the expected 50% Duty Cycle on the analyser. However irrespective of the frequency set under properties, I always get half of expected. If set at 7.8KHz I get 3.9KHz etc.
Freely admit to only starting to play with the Uno so maybe I'm doing something stupid.
Regards
Working now sort of....
With Duty set to 128 I get the expected 50% Duty Cycle on the analyser. However irrespective of the frequency set under properties, I always get half of expected. If set at 7.8KHz I get 3.9KHz etc.
Freely admit to only starting to play with the Uno so maybe I'm doing something stupid.
Regards