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.

p5315

Member Since 29 Oct 2013
Offline Last Active Jan 13 2015 01:52 PM
-----

Topics I've Started

More then 5 InterruptPort s

19 December 2013 - 02:59 AM

Hi!

Im new tor the netduino comunity but i would like to know if there are only 5 InterruptPort available on the

netduino plus 2?

i have made a test program for the InterruptPorts since i need 6 of them.

using System;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.Netduino;using Toolbox.NETMF.Hardware;namespace testinterupt.cs{    public class Program    {        static InterruptPort[] btn = new InterruptPort[6];        public static void Main()        {            btn[0] = new InterruptPort(Pins.GPIO_PIN_D4, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[0].OnInterrupt += ljud_OnInterrupt;            btn[1] = new InterruptPort(Pins.GPIO_PIN_D2, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[1].OnInterrupt += cinemaMode_OnInterrupt;            btn[2] = new InterruptPort(Pins.GPIO_PIN_A0, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[2].OnInterrupt += projector_OnInterrupt;            btn[3] = new InterruptPort(Pins.GPIO_PIN_D7, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[3].OnInterrupt += knobPuch_OnInterrupt;            btn[4] = new InterruptPort(Pins.GPIO_PIN_A2, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[4].OnInterrupt += knobPuch_OnInterrupt;            btn[5] = new InterruptPort(Pins.GPIO_PIN_A1, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[5].OnInterrupt += projector_OnInterrupt;            while (true)            {                Thread.Sleep(1000);                Debug.Print("main is alive");            }        }        public static void Knob_Rotated(uint Unused, uint value, DateTime Time)        {            Thread.Sleep(100);        }        public static void ljud_OnInterrupt(uint Unused, uint value, DateTime Time)        {            Thread.Sleep(100);        }        public static void cinemaMode_OnInterrupt(uint Unused, uint value, DateTime Time)        {            Thread.Sleep(100);        }        public static void projector_OnInterrupt(uint Unused, uint value, DateTime Time)        {            Thread.Sleep(100);        }        public static void knobPuch_OnInterrupt(uint d, uint e, DateTime r)        {        }    }}

Thanks Simon


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.