Counting RPM inside a function

You don't seem to understand. A short paragraph does not constitute all the hardware details you possibly can.

It is not an unusual request, it's a standard requirement of the forum that you post interconnection diagrams and links to documentation for all the component modules, or at least to a product page.