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 05 Feb 2013
Offline Last Active Jun 10 2013 12:36 AM

Posts I've Made

In Topic: Troubles with sonar sensors

16 May 2013 - 12:26 AM

Shadi, The trouble is that I'm not getting any interrupt on a echo port.

In Topic: Troubles with sonar sensors

15 May 2013 - 07:36 PM

Still didn't work. If I use PIN4 it gets stuck in while (lineState == false). If I connect it to PIN5 it gets stuck in while(lineState).


Also when I connect it to PIN13 every time the port Writes(true) or false, it turnes on or off netduinos blue LED. 


What am i doing wrong?




        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;        }


In Topic: Troubles with sonar sensors

15 May 2013 - 01:14 AM

I modified the code from here,



and the files are here for Netduino Plus 2 (in VB),



The cheap HC-SR04 modules are spotty at best. I wasted a lot of time with a bad one. The above code works just fine. I merely added some smoothing routines. The module is powered from the Netduino 5V pin.


Thank you, I will try to use and see how it works.

Are there any limitations on the pins which I can use?

In Topic: Interrupts on TristatePort

11 February 2013 - 07:26 AM

Guys, I ran into a same issue. 

I might try to burn tow ports at this point. Could you please share the code for this?




In Topic: Servo power wiring to Netduino Plus 2

11 February 2013 - 06:54 AM

I prefer to use separate supplies for logic and motors.

My Netduino became erratic when it shared the same battery pack as my buggy's motors.




Yeah, i felt that too..

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.