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

Missing Functions/Classes


  • Please log in to reply
1 reply to this topic

#1 lvnick

lvnick

    New Member

  • Members
  • Pip
  • 1 posts

Posted 29 December 2012 - 03:30 AM

Hi All -

I just received my Netduino Plus 2 and have been able to get several things working in the projects listed in the "Getting Started with Netduino" book.  It seems that several of the functions/classes that are associated with don't exist.

 

For example, I'm trying to use a servo.  I did the following:

 

PWM servo = new Microsoft.SPOT.Hardware.PWM(Pins.GPIO_PIN_D5);   uint firstPosition = 1000;   uint lastPosition = 2000;   for (uint currentPosition = firstPosition;   currentPosition <= lastPosition;   lastPosition += 10)   {     }

 

but when I go inside of the for loop and try to put in servo.SetPulse(20000,currentPosition); SetPulse does not show up as an option in the dropdown.  I get an error on declaring the servo variable with Pins.GPIO_PIN_D5, so I've also tried adding 100, 100, false and I've also tried replacing it entirely with SecretLabs.NETMF.Hardware.Netduino.PWMChannels.PWM_PIN_D5,100,100,false

 

Asside from the example above I've also had issues with the function SetDutyCycle for controlling the color of LED's and instead had to set the property directly.

 

Am I just missing something completely obvious or is it that this book is out of date or???

 

Any help would be appreciated!

 

Thanks -Nick



#2 Gutworks

Gutworks

    Advanced Member

  • Members
  • PipPipPip
  • 363 posts
  • LocationOttawa, Ontario

Posted 29 December 2012 - 06:57 AM

Hi Nick,

 

Welcome to the Netduino Community! You've got yourself an awesome piece of new hardware. The Netduino Plus 2 is the latest offering from Secret Labs and the Getting Started with Netduino book is a fantastic book that I have referenced often. Unfortunately the book was released in February of 2012 and since then there have been several updates to the .Net Micro Framework and to some to the Secret Labs firmware. But no worries. With a few tweaks you should be able to get all of your projects up and running. 

 

Since the release of the book there has been a major change with the PWM classes in the NEMTF and the new Microsoft.SPOT.Hardware.PWM class is one of them. Instead of using this PWM class, the book uses the Secret Labs PWM class which has a few different methods and constructor. 

 

In order to get your book samples running you will need to right click on "References" which is found under your project in the Solutions Explorer of Visual Studio. Next make sure you select the .Net tab and scroll down and add SecretLabs.NETMF.Hardware.PWM to your project. 

 

Now wherever you reference the PWM object, just use:

 

SecretLabs.NETMF.Hardware.PWM servo = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5);

If you run into any other issues, please feel free to ask them here and we'll try and help you as much as possible. Once you mastered the concepts in the book, I suggest you check the forums for some examples that use the Microsoft PWM class. 

 

Have fun!

 

Steve






1 user(s) are reading this topic

0 members, 1 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.