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

Adding an interupt port to a class


  • Please log in to reply
No replies to this topic

#1 Adam Clifford

Adam Clifford

    Member

  • Members
  • PipPip
  • 18 posts

Posted 26 July 2011 - 11:12 AM

Hi Guys and Gals,

I am trying to write an interrupt based rotary encoder switch library that has three events, clockwise, counterclockwise and button push.

However when I try to add an interupt port to the class it just doesnt show up.

Here is my code so far
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;
using SecretLabs.NETMF;

namespace RotaryEncoderSwitch
{
    public class RotarySwitch
    {
        private int _pinA;
        private int _pinB;
        private int _switchPin;
        private bool _positiveEdge;
        
        public delegate void ClockwiseEventHandler();
        public delegate void CounterClockWiseEventHandler();
        public delegate void ButtonPushedEventHandler();

        public event ClockwiseEventHandler ClockWise;
        public event CounterClockWiseEventHandler CounterClockWise;
        public event ButtonPushedEventHandler ButtonPushed;

        public RotarySwitch(int pinA, int pinB, int switchPin, bool positiveEdge)
        {
            _pinA = pinA;
            _pinB = pinB;
            _switchPin = switchPin;
            _positiveEdge = positiveEdge;
        }
    }
}

I would like to add a static private interrupt port to the class but it wont let me.

does anyone have any ideas why?


Doh, Forgot to add all of the correct references
Adam Clifford




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.