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

Getting Strange Errors with PWM code

PWMerror messages Visual Studio 2010 Visual Basic C#

  • Please log in to reply
2 replies to this topic

#1 dougd

dougd

    New Member

  • Members
  • Pip
  • 2 posts

Posted 26 June 2013 - 09:23 PM

I have been playing around with a Netduino 2 for the past few days without encountering any problems, until I tried PWM.

 

In  VS C# 2010 Express, I type:   PWM pwm = new PWM(Pins.GPIO_PIN_D5); and get this error :

'Microsoft.SPOT.Hardware.PWM' does not contain a constructor that takes 1 argument"

 

So I tried VS Visual Basic 2010 Express, and typed:  Dim led1 As PWM = New PWM(Pins.GPIO_PIN_D5)

and get this error: Overload resolution failed because no accessible 'New' accepts this number of arguments.

 

In all the examples I've seen, New PWM only takes one argument - the GPIO pin.  Does any one know what I am missing or what's going on here?



#2 SteveAndrews

SteveAndrews

    Member

  • Members
  • PipPip
  • 17 posts
  • LocationOrange County, CA

Posted 27 September 2013 - 10:10 AM

I've been wondering that myself, so I did some searching and dug up this post reply:

http://forums.netdui...with-c/?p=47840



#3 gismo

gismo

    Advanced Member

  • Members
  • PipPipPip
  • 110 posts

Posted 21 November 2013 - 06:51 PM

I hope you've figured it out by now, but here's a code to make it work:

PWM pwmPin = new PWM(PWMChannels.PWM_PIN_D6, 1000,.5,false); //2nd value is frequency in Hz(I suppose) and 3rd is Duty Cycle from 0.0 to 1.0pwmPin.Start();






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.