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

How do the input pins work ?


  • Please log in to reply
2 replies to this topic

#1 bgreer5050

bgreer5050

    Member

  • Members
  • PipPip
  • 28 posts

Posted 06 February 2015 - 04:43 PM

Can I use input pins in both fashions:

 

  • Send 3.3 volts to the pin and the controller will detect the pin as interrupted.
  • Ground the pin and the controller will detect the pin as interrupted.

If this is the case, does the controller automatically detect this ?

What is best practice ?

 

 



#2 bgreer5050

bgreer5050

    Member

  • Members
  • PipPip
  • 28 posts

Posted 07 February 2015 - 10:25 PM

Anyone ?



#3 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 12 February 2015 - 01:49 PM

Hi,

 

I am using a Netduino plus v1 with v4.2 firmware.

 

In C# I use:

using System;
using Microsoft.SPOT.Hardware;

InterruptPort port = new InterruptPort(pin, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeLow);

The mode at the end can be set to:

Port.InterruptMode.InterruptEdgeHigh, 
Port.InterruptMode.InterruptEdgeLow, 
Port.InterruptMode.InterruptEdgeBoth, 
Port.InterruptMode.InterruptEdgeLevelHigh, 
Port.InterruptMode.InterruptEdgeLevelLow

I think you are describing "Both"

 

Be aware that after the v4.1 to v4.2 firmware update, there are now two ways to configure inputs - Secret labs and Microsoft. So you may have issues using other people's code snippets unless you get the correct using statements and references. It had me confused for a while.

 

Hope this helps - Paul






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.