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

Servos in NETMF 4.2


  • Please log in to reply
21 replies to this topic

#21 chungenhung

chungenhung

    Member

  • Members
  • PipPip
  • 27 posts

Posted 21 September 2012 - 02:51 AM

In "Public class Program", I have "static Microsoft.SPOT.Hardware.PWM _servo;".
In "public static void Main()", I have "_servo = new Microsoft.SPOT.Hardware.PWM(PWMChannels.PWM_PIN_D10, 20000, 1500, PWM.ScaleFactor.Microseconds, false);"
In "static void button_OnInterrupt", I have "_servo.duration = 1500;". Now it's complaining about "duration".
Error message "Microsoft.SPOT.Hardware.PWM does not contain a definition for duration."

Nevermind. The error is gone now.
Thanks!

#22 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 21 September 2012 - 03:46 AM

Hi chungenhung,

In "static void button_OnInterrupt", I have "_servo.duration = 1500;". Now it's complaining about "duration".
Error message "Microsoft.SPOT.Hardware.PWM does not contain a definition for duration."

C# is a case-sensitive language. Be sure to use a capital D in "Duration".

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.