SR LIBRARY SYSTEM

updated 12 jan 2019

This is out of date and awaiting update -- 10 jan 2023

this is documentation for my Arduino (and similar microcontroller) libraries. they exist to support fast, easy to use and appropriately-scaled real-time, event-driven coding practices. most of these require the use of an event loop strategy that is strongly implied by the Arduino team's loop() skeletal program structure.

all of this code is appropriately scaled for the Arduino environment. these are not dragged in from a "desktop" software environment, but coded specifically for good performance from minimalist hardware -- which means they are even faster on fast processors.

all of the major functions provided here are designed to be invoked repeatedly from loop(), as often as possible. with rare and documented exceptions all of the code thus inserted into loop() executes in tens of microseconds -- my code does not block.

in short, all of this is meant to be used within a particular strategy towards structuring code. documention on that strategy is forthcoming (fall 2015). for now this is the start of the component documentation.

LIBRARY OBJECTS

the following objects are in the library at this time. click the link to go to the documentation page. they are all available from my github repository. they install in the usual way.

object

description

library

SRTimer

timed event/time-as-event functions.

SRResources
SRLog

Console logging, time and date functions.

SRResources
SRLED

LED-blinking manager.

SRResources
SRButton

momentary pushbutton switch and digital sensor functions.

SRResources
SRCRC

CRC-8 polynomial functions.

SRResources
SRPRNG

8, 16, and 32-bit Marsaglia XORshift pseudo-random number sequence generators. much faster and somewhat smaller than built-in random(). 8 and 16 bit are far more than adequate for non-crypto purposes.

SRResources
SRLoopTally

tool for performance-checking non-blocking code.

SRResources
SRMessage

compact generalized message-parsing system.

SRResources
SRSmooth

Exponential Smoothing function. . "...a rule of thumb technique for smoothing time series data... Like any application of repeated low-pass filtering, the observed phenomenon may be an essentially random process, or it may be an orderly, but noisy, process. Whereas in the simple moving average the past observations are weighted equally, exponential window functions assign exponentially decreasing weights over time..."

SRSmooth
SRPID

proportional integral derivative functions of suitable scale for small controllers. integer and float versions. ideal for deriving change information from any proportional analog sensor. as well as typical closed-loop control.

SRPID
obsolete SRPID

this is the previous SRPID code, all integer. use the floating point version above. this integer version will be slightly faster in some cases, but it uses an array for the simple moving average integrator which means that parameter is not runtime tunable, and SMA has some noise issues.

old SRPID
Integrator

integration and averaging functions.

SRPID
Differentiator

differentiation functions.

SRPID
SRFlock

novel self-configuring radio network system that uses SRRF24 (below) for transport. built-in SRMessage support.

SRRadio
SRRF24

robust, fast, compact, thorough driver for absurdly inexpensive Nordic NRF24L01+ 2.4GHz radio module.

SRRadio
Website contents, unless otherwise specified, © 2023 by Tom Jennings is licensed under CC BY-SA 4.0