Main Site Documentation

Snippet - Counting pulses over time with RLP


[title]Counting pulses over time with RLP[/title]
This example demonstrates how to count fast pulses using GPIO interrupts with RLP. In this example only one IO is used (P0.4 which is Button down on the FEZ Cobra). It is possible to use any pin on PORT0 and PORT2.

The query method takes an array of 5 ushorts. The first ushort will receive the number of milliseconds elapsed since the previous call to query. The following ushort values contain 4 counters that contain the number of falling edges occured on the GPIO since the previous call to query. (In this example only the first counter is used, since only one GPIO is configured).

Source code contains the RLP code, while usage example contains a managed wrapper class.