Speed and turning control with Ardumoto - Motor Driver Shield
#1
Posted 13 November 2010 - 08:14 PM
#2
Posted 14 November 2010 - 12:07 AM
#3
Posted 14 November 2010 - 01:12 AM
cool thanks I tried that as well I think I am not using it correctly later on not to sure where to reference the duty cycle if thats what I am supposed to doYour syntax is wrong:
PWM pwm1 = new PWM(Pins.GPIO_PIN_D3);
PWM pwm2 = new PWM(Pins.GPIO_PIN_D11);
I think is more what you want?
get this error
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in SecretLabs.NETMF.Hardware.dll
I think this means I am not defining later in the code what I want pwm1 and pwm2 values to be so I tried this well ...lets take a look
// write your code here
PWM pwm1 = new PWM(Pins.GPIO_PIN_D3);
PWM pwm2 = new PWM(Pins.GPIO_PIN_D11);
OutputPort Motor1 = new OutputPort(Pins.GPIO_PIN_D12, false);
OutputPort Motor2 = new OutputPort(Pins.GPIO_PIN_D13, false);
while (true)
{
Motor1.Write(true);
pwm1.SetDutyCycle(100);
Thread.Sleep(500);
Motor1.Write(false);
Motor2.Write(true);
pwm2.SetDutyCycle(100);
Thread.Sleep(500);
Motor2.Write(false);
}
but I don't think thats where it is supposed to go
#4
Posted 14 November 2010 - 06:21 AM
#5
Posted 14 November 2010 - 12:41 PM
#6
Posted 14 November 2010 - 02:27 PM
cool that was it wrong pin thanks for the helpI didn't catch this the first time, but I think PWM is only supported on pins 5,6,9,10 -- not 3 and 11.
Specs are here: http://www.netduino....duino/specs.htm
digital i/o features
● all 20 digital and analog pins: GPIO
● digital pins 0-1: UART 1 RX, TX
● digital pins 2-3: UART 2 RX, TX
● digital pins 5-6: PWM, PWM
● digital pins 7-8: UART 2 RTS, CTS
● digital pins 9-10: PWM, PWM
● digital pins 11-13: SPI MOSI, MISO, SPCK
● analog pins 4-5: I2C SDA, SCL
#7
Posted 14 November 2010 - 02:31 PM
#8
Posted 14 November 2010 - 08:29 PM
Attached Files
#9
Posted 06 December 2010 - 05:40 PM
this is what I have it is hard to tell is the motors are running slower until I have it on the ground but no errors
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
namespace NetduinoApplication1
{
public class Program
{
public static void Main()
{
// write your code here
PWM pwm1 = new PWM(Pins.GPIO_PIN_D6);
PWM pwm2 = new PWM(Pins.GPIO_PIN_D9);
OutputPort Motor1 = new OutputPort(Pins.GPIO_PIN_D12, false);
OutputPort Motor2 = new OutputPort(Pins.GPIO_PIN_D13, false);
while (true)
{
pwm2.SetDutyCycle(100);
pwm1.SetDutyCycle(100);
Motor1.Write(true);
Motor2.Write(true);
Thread.Sleep(5000);
pwm2.SetDutyCycle(100);
pwm1.SetDutyCycle(100);
Motor1.Write(false);
Motor2.Write(false);
Thread.Sleep(5000);
}
}
}
}
I cut and jumper-ed the pins on the motor shield to get them to line up I am using an old base from a TAB book on the basic stamp take a look
I started a post to learn how to get my "Adafruit Motor Shield" to work but maybe you can help. How do I know what port on my shield is which. Also, do I need a different driver. I was told "4 PWM, not 6..." and I may have to make a driver.
Here's my post: http://forums.netdui...t=668&qpid=4916
#10
Posted 21 September 2011 - 03:59 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users