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.

ColinR's Content

There have been 2 items by ColinR (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#57256 Netduino send ICMP Ping ?

Posted by ColinR on 01 April 2014 - 09:02 AM in Netduino Plus 2 (and Netduino Plus 1)

To get back to this issue, I've tested Colin's 3 source files he posted above on the Netduino Plus 2, and it works. However, when the network is not available, an exception gets thrown instead of a false being returned.

 

Successful pings return a true though, so this is definitely a solution.

 

Perfect, so we'll know:

 

I'm alive, remote dead
I'm alive, remote alive,

I'm dead




#50341 Input Debounce

Posted by ColinR on 07 June 2013 - 07:01 AM in Netduino Plus 2 (and Netduino Plus 1)

I set up my software debounce like this:  

	static long lastDebounceTime = DateTime.Now.Ticks;          static long debounceDelay = 100000;   //adjust as necessary	public static void Main() {		InterruptPort input = new InterruptPort(Pins.GPIO_PIN_D4, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);        	input.OnInterrupt += new NativeEventHandler(input_OnInterrupt);	}	 	static void input_OnInterrupt(uint data1, uint data2, DateTime time)        {            if ((time.Ticks - lastDebounceTime) > debounceDelay)            {                           lastDebounceTime = time.Ticks;		// do stuff            }        }
Thanks everyone for the help.

 

 

Some micro optimisation :) The exact time the interrupt occured is already given, no need to call DateTime.Now.





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.