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

PWM - Deploy Fail


  • Please log in to reply
4 replies to this topic

#1 zee

zee

    Advanced Member

  • Members
  • PipPipPip
  • 47 posts

Posted 07 March 2013 - 09:02 AM

Hi,

 

This is my second time try to run this project. Its from the 'Getting Started with Netduino' on Chapter 6, Dimmer Code..I have installed the SecretLabs.NETMF.Hardware.PWM and there is no error in the code. However, when it is running, it states that "unable to communicate with device - USB:Netduino" under the output tab.

There is also a message box pop-up "There were deployment errors. Continue?".

 

 

Please help me !!! Thank you!



#2 ziggurat29

ziggurat29

    Advanced Member

  • Members
  • PipPipPip
  • 244 posts

Posted 07 March 2013 - 02:36 PM

I get that all the time with projects unrelated to PWM, but I always assumed it was because I run my dev env in a vmware image (and USB is always a little hinky in that case).  I unplug and plug back in, sometimes restarting VS2010 and things become stable again.

 

That being said, since you mention PWM, I found out myself that if you set the PWM frequency too low, you can lock up the netmf system, so don't set it too low.  Sorry, can't remember what 'too low' is; in my case I had a typo and I set it to 10 Hz, but I think 'too low' is actually something like 100 or 100 Hz.



#3 zee

zee

    Advanced Member

  • Members
  • PipPipPip
  • 47 posts

Posted 08 March 2013 - 12:37 AM

Hi.. Thanks for the quick reply.. I did not set any frequency on it.

 

Here are my codes..

 

 

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
 
namespace Dimmer_PWM
{
    public class Program
    {
        public static void Main()
        {
            // write your code here
 
            SecretLabs.NETMF.Hardware.PWM led = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5); 
            SecretLabs.NETMF.Hardware.AnalogInput pot = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);
            pot.SetRange(0, 100);
            int potValue = 0; //store and retrieve the potentiometer's current position
 
            while (true)
            {
                //read the value of the potentiometer
                potValue = pot.Read();
 
                //change the led intensity base on the potentiometer's value (0-100%)
               led.SetDutyCycle((uint) potValue);
                             
            }
 
        }
 
    }
}


#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 March 2013 - 06:55 PM

Hi zee, The code looks fine at first glance. Let's check out the other variables... What board are you using? Netduino? Netduino Plus 2? When you open up project properties, and then go to the .NET MF tab...do you see your Netduino in the device pulldown? When deployment fails, go to the Output tab in Visual Studio. If it shows more information about what failed during deployment, please post that info here. Chris

#5 zee

zee

    Advanced Member

  • Members
  • PipPipPip
  • 47 posts

Posted 15 March 2013 - 03:37 AM

Hi zee, The code looks fine at first glance. Let's check out the other variables... What board are you using? Netduino? Netduino Plus 2? When you open up project properties, and then go to the .NET MF tab...do you see your Netduino in the device pulldown? When deployment fails, go to the Output tab in Visual Studio. If it shows more information about what failed during deployment, please post that info here. Chris

 

Hi Chris,

 

Thanx for the response..

 

I am using Netduino Plus 2.. Yes, there is Netduino in the device pulldown.. 

The error in the output tab, stated "Unable to communicate with device - USB: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.