Author Topic: Count Hardware Driven Events  (Read 133 times)


  • Newbie
  • *
  • Posts: 3
    • View Profile
Count Hardware Driven Events
« on: December 01, 2016, 03:32:30 am »
Is it possible to count hardware event instances?  For example an accelerometer interrupt or reed switch is triggered, some logic is executed and the event ends.  I am wanting to know how many times this occurs over a given time period.  I tried to create a new list and add a counter byte to a list but you can only do this within the event so the next time the event occurs it just creates a new list. 

Share on Facebook Share on Twitter


  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: Count Hardware Driven Events
« Reply #1 on: December 01, 2016, 08:12:57 am »
Just create a "Shared" counter and keep increasing that. It must be shared because local variables are always in initialized when the function, sub or event is executed.