Netduino home hardware projects downloads community

Jump to content

The Netduino forums have been replaced by new forums at This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.


Member Since 22 Dec 2012
Offline Last Active Feb 22 2014 07:53 AM

Topics I've Started

Unable to communicate with Mini

18 February 2014 - 12:31 AM

 Just received my Netduino mini. I snapped it in a Parallax BOE/usb, installed the latest 4.2 of the .netmf & netduino sdk and tried a small test app, no luck.


The board appears as COM 4 on my laptop.  I tried MFDeploy, but no luck.  When I'm trying to deploy my test app or trying to ping using MFDeploy, I can see the leds on the BOE flashing but I'm not communicating with the mini.


Advice appreciated.



NP2 Bricked?

18 October 2013 - 08:26 PM

While trying new code to get my Parallax Ping Distance Sensor to work, it now appears my NP2 is toast. 


While attempting to download my code to the device, it hung.  I disconnected the usb cable and my computer instantly rebooted (that was a little scary).  After that happened and my computer appeared to be ok, I reconnected the NP2.  It's recognized in Windows 7 under Control Panel -> Devices and Printers' but not in the Device Manager (it no longer takes a com port). I launched DfuSe Demo, hoping it may see it but no luck. When disconnecting the usb cable again another computer reboot (different usb cable).  I tried reconnecting the NP2, holding the reset button to put it in program mode and I was able to erase it with DFU.  I was successfully able to reflash it with 4.2.2 and I thought I was back in business, apparently not. I tried erasing and reflashing once more but no luck, it won't obtain a com port.


It's kind of annoying.  For fifty bucks, I would have liked to seen it function more than a couple times but, oh well.  Fortunately, it didn't appear to harm my computer.

Parallax - Ultrasonic Distance Sensor does not work

16 October 2013 - 10:59 PM

I have an NP2 connected to a Parallax BOE Shield and a Parallax Ping Ultrasonic Distance Sensor. The ping sensor is connected to the BOE shield using the 5V pin and the Gnd pin right next to it, I've tried multiple I/O pins but no success with the ping sensor.  To ensure the ping sensor was working, I connected it to another Parallax board I have and it worked fine. Below, is the code I'm using for the NP2, I found it on this forum.  I've read where some have had success with it and others have not. Not knowing what to try next, I swapped out the NP2 with an Arduino uno and left the ping sensor exactly how I had it connected on the BOE shield.  It worked with no problems.


I'd still like to give the NP2 a chance but I don't know what to try next. Suggestions are welcome.


Thank you.




using System; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.Netduino;

namespace ParallaxSensors {   /******************************************************************* * Reference the following DLLs *  - Microsoft.SPOT.Hardware *  - Microsoft.SPOT.Native *  - SecretLabs.NETMF.Hardware *  - SecretLabs.NETMF.Hardware.Netduino ******************************************************************/

  /// <summary>   /// Holds the distance information for the event   /// </summary>   public class PingEventArgs   {   public PingEventArgs(int distance)   {   Distance = distance;   }

  public int Distance { get; set; }   }

  /// <summary>   /// Implements a timer based distance measurement of distance (in cm) using the   /// parallax Ping sensor   ///   /// Example usage:   /// public static void Main()   /// {   /// Ping ping = new Ping(Pins.GPIO_PIN_D2, 1000, true);   /// ping.RangeEvent += new Ping.RangeTakenDelegate(ping_RangeEvent);   ///   /// // Sleep forever!   /// Thread.Sleep(Timeout.Infinite);   /// }   ///   /// static void ping_RangeEvent(object sender, PingEventArgs e)   /// {   /// Debug.Print("Range: " +  e.Distance + " cm");   /// }   /// </summary>   public class Ping   {   public delegate void RangeTakenDelegate(object sender, PingEventArgs e);   public event RangeTakenDelegate RangeEvent;

  private TristatePort _port;   private ExtendedTimer _timer;   private int _period;   private bool _enabled;

  /// <summary>   /// Constructor: initializes the Ping class   /// </summary>   /// <param name="pin">which pin the sensor is connected to</param>   /// <param name="period">time between pulses in millisec, minimum of 1000</param>   /// <param name="enabled">if true, start pinging immediately, otherwise wait for enable</param>   public Ping(Cpu.Pin pin, int period, bool enabled)   {   _port = new TristatePort(pin, false, false, ResistorModes.Disabled);

  // Initially set as disabled.   _timer = new ExtendedTimer(TakeMeasurement, null, Timeout.Infinite, period);

  // Store the current period   Period = period;

  // Set the enabled state   Enabled = enabled;   }

  /// <summary>   /// Enable or disable the timer that triggers the read.   /// </summary>   public bool Enabled   {   get { return _enabled; }   set   {   _enabled = value;

  _timer.Change((_enabled) ? 0 : Timeout.Infinite, Period);   }   }

  /// <summary>   /// Set the period of pings, min is 1000ms   /// </summary>   public int Period   {   get { return _period; }   set   {   _period = value;   if (_period < 1000)   _period = 1000;

  // Set enabled to the current value to force update   Enabled = _enabled;   }   }

  /// <summary>   /// Get distance in cm   /// </summary>   /// <returns>distance in cm, based on wikipedia for dry air at 20C</returns>   private int GetDistance()   {

  // First we need to pulse the port from high to low.   _port.Active = true; // Put port in write mode   _port.Write(true); // Pulse pin   _port.Write(false);   _port.Active = false;// Put port in read mode;  

  bool lineState = false;

  // Wait for the line to go high, for start of pulse.   while (lineState == false)   lineState = _port.Read();

  long startOfPulseAt = System.DateTime.Now.Ticks;   // Save start ticks.

  // Wait for line to go low.   while (lineState)   lineState = _port.Read();

  long endOfPulse = System.DateTime.Now.Ticks;   // Save end ticks.

  int ticks = (int)(endOfPulse - startOfPulseAt);

  return ticks / 580;   }

  /// <summary>   /// Initiates the pulse, and triggers the event   /// </summary>   /// <param name="stateInfo"></param>   private void TakeMeasurement(Object stateInfo)   {   int distance = GetDistance();

  if (RangeEvent != null)   {   RangeEvent(this, new PingEventArgs(distance));   }   }   } }

NP2 vs. Arduino

21 February 2013 - 07:51 PM

I'm am brand new to working with microcontrollers, so if my terminology is off or my questions don't make a lot of sense, please understand.  I recently bought the NP2, primarily because it uses the .Net MF. I have several years of experience with .net/c# and thought it would probably be as good of a place to start as any. 


My topic title might be slightly misleading, I'm not looking for a discussion of the merits of one over the other, what I'm after is some information about the differences schematically. There are a lot more reference materials and books about the Arduino and I found one that covers a topic I'm interested in but it's for the Arduino.  So, my question is, when I'm following examples in the book, how close or different will board specific references be? 


Also, are Arduino expansion shields compatible with the netduino? e.g. motor shields, network shields, etc.



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.