Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Error when trying to use PWM to regulate motor speed


  • Please log in to reply
1 reply to this topic

#1 Rhynorater

Rhynorater

    New Member

  • Members
  • Pip
  • 1 posts

Posted 02 March 2014 - 09:49 PM

Hey guys,

 

I just got a Netduino and so far it is AMAZING! However, I am running into one problem that is really buggin me. When I'm trying to regulate the speed of my motor using a PWM pin, its giving me the following error.

 

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in SecretLabs.NETMF.Hardware.dll

 

 

Here is the code I'm using:

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()
        {
            PWM x = new PWM(Pins.GPIO_PIN_D0);
            x.SetDutyCycle(50);
            x.Dispose();
            

        }

    }
}



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 March 2014 - 05:40 AM

Hi Rhynorater,

Pin D0 is not a PWM pin :)

On Netduino 1, pins D5-D6 and D9-D10 are PWM pins.

For the full pin-out, check out the IO specs in the right side column.
http://www.netduino....duino/specs.htm

Does that get you up and running?

BTW, welcome to the Netduino community!

Chris




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.