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.

aalmada

Member Since 26 Apr 2011
Offline Last Active Dec 04 2012 09:14 AM
*****

Topics I've Started

Servos in NETMF 4.2

09 September 2012 - 04:39 PM

Hi,

I recently upgraded my Netduino to 4.2.0 firmware. I'm now updating my code and I'm having an issue with the new PWM class and servos.

Servos expect a PWM with 20ms period and high signal duration from 1 ms to 2ms. I wrote the following using the new native PWM:

var servo = new Microsoft.SPOT.Hardware.PWM(PWMChannels.PWM_PIN_D10, 20000, 1000, PWM.ScaleFactor.Microseconds, false);
while (true)
{
    Thread.Sleep(1000);
    servo.Duration = 2000; // 2 ms
    Thread.Sleep(1000);
    servo.Duration = 1000; // 1ms
}

And the following using the SecretLabs PWM implementation:

var pwm = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D10);
uint period = 20000;
while (true)
{
    pwm.SetPulse(period, 1000); // 1 ms
    Thread.Sleep(1000);
    pwm.SetPulse(period, 2000); // 2 ms
    Thread.Sleep(1000);

}

Both examples make the servo move but, it doesn't move 90º and the 2 ms position forces the servo. Am I doing something wrong?

Thanks!

Fixed-point arithmetic

04 May 2012 - 08:43 AM

Hi, I implemented a fixed-point arithmetic class hoping to get some performance boost on my apps. I did some benchmarking on the Netduino and found that it actually slows down considerably. It's a fully managed implementation and that may be the problem. Any feedback is welcome. Here is the code: https://bitbucket.or...ed/Fixed1516.cs aalmada

Nunchuck controlled Bionicle

22 April 2012 - 02:06 PM

Here is a video of a little project I implemented last weekend with my kids. :rolleyes:

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.