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

Interrupt on output port?


  • Please log in to reply
2 replies to this topic

#1 twinnaz

twinnaz

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationBrampton, Ontario

Posted 30 January 2014 - 06:56 PM

Imports Microsoft.SPOTImports Microsoft.SPOT.HardwareImports SecretLabs.NETMF.HardwareImports SecretLabs.NETMF.Hardware.NetduinoModule Module1    Sub Main()        Dim led As New OutputPort(Pins.ONBOARD_LED, False)        Do            led.Write(True)            Thread.Sleep(250)            led.Write(False)            Thread.Sleep(250)        Loop    End SubEnd Module

Hello how would I go about counting every time the onboard led goes high with an interrupt in this code and display the state (true or false) in the Debug.Print window

 


Netduino Plus 2


#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 31 January 2014 - 03:39 AM

Hi twinnaz, OutputPorts don't have interrupt events; interrupts are only capture for incoming signals (from outside sources). The good news is that it's pretty easy for you to wire up an event yourself for this. For instance you could create a function which calls OutputPort.Set(...) and also fires off your event. Does that help point you in the right direction? Chris

#3 twinnaz

twinnaz

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationBrampton, Ontario

Posted 31 January 2014 - 03:43 AM

Reply I got it working I just put in a led.read to a counter everytime led.read goes high or true you can delete post thanks

Netduino Plus 2





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.