mc-Things

mc-Products => mc-Module => Topic started by: dc on December 01, 2016, 03:32:30 am

Title: Count Hardware Driven Events
Post by: dc 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. 
Title: Re: Count Hardware Driven Events
Post by: mc-John 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.