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 Started book .. PWM code in Sect 7 ... not working

PWM Getting Started with Netduino

  • Please log in to reply
No replies to this topic

#1 Magic Dragon Portal

Magic Dragon Portal

    New Member

  • Members
  • Pip
  • 5 posts

Posted 06 January 2015 - 06:06 PM

I'm trying to do as the book suggests but I'm stuck on this simple first exercise of making my MG996R Tower Pro servo move.

 

Attached image shows what book says to do.

 

I've researched other posts, and got past the constructor problem. Thanks to Chris Walker's post, I included a reference to SecretLabs.NETMF.Hardware.PWM (version 4.0.30319). That got the constructor to take a single argument as this book specifies.

 

Now I want to move the servo through its full range, 180 degrees. This code doesn't do that, nor does it seem to work. The servo moves, but not just a single 90 degree arc.

 

Two questions, please.

 

1. What code do I use to insure that I know where the servo is starting at? I'd like to have it initialized to halfway: can move 90 degrees left of 90 degrees right. I think I have to assume it could have been left at any position the last time it had power.

 

2. What code do I use to make it move 45 degrees from this initial state? Doesn't matter which direction. I can figure that out once I can make it move 45 degrees. I can figure everything else out as well, once I can do this simple logic.

 

Its a Plus2 that I bought a few months ago. I bet a lot of "This book no longer works" questions have been posted, but I couldn't find a complete solution to this simple task.

Attached Files







Also tagged with one or more of these keywords: PWM, Getting Started with Netduino

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.