A library written in Arduino C++ for modular plug-and-play low-level control systems through a high-level API. Implemented with PlatformIO and tested on AVR.
The goals of this library are threefold:
- Error-free asynchronous communication with a dynamic list of multiplexers and I2C devices;
- Abstraction from those multiplexer groups into hot-swappable
Module
s, and I2C devices intoSensor
s (environment variable getters) andActuator
s (environment variable setters); - Mapping together
Sensor
s andActuator
s into coherentControlSystem
s: feedback systems, each with a "parameter" that can be set as the target value of the environment variable of interest;
This will eventually be migrated to an Arduino library. For now, see #Development##Installation
pio test -e peapod
PeaPod (God Object)
|-ControlSystem*'s HashMap (for instruction handling & calculation)
| |-Control Systems [key: environment variable being controlled]
| |-Sensor* (envvar getter)
| |-Actuator* (envvar setter)
| |-parameter (string)
| |-target (float)
|
|-Module List (hardware state change tracking -> Interface lifecycle management)
| |-Sensor* Array
| |-Actuator* Array
| |-Interface* Array (support)
| |-array lengths (byte)
Interface
|-ADC
|-EEPROM
|-GPIO
|-PWM
|-Any I2C Sensors/Actuators (multiple inheritance)
Module (MUX device)
Sensor
|-All Sensors
Actuator
|-All Actuators
Not including external libraries or
utils/
.
Interface
|-MUX (also included in Interface)
|-All other interfaces
|-All I2C Sensors/Actuators
- Sensor and actuator instance-related code should not be const
- Static API code (i.e. ids, factories) should be const (and preferrably PROGMEM)
- Avoid passing around pointers to const pointers. It's already const.
- I2C: JST SH 1.00mm 4-pin (1: GND, 2: +5V, 3: SDA, 4: SCL)
- Middleware Output Signals: Molex Micro-Lock PLUS 2-pin (1: Signal, 2: GND)
- Endware Recieving Signals: Molex Micro-Lock PLUS 2-pin (1: GND, 2: Signal)
- Power: Molex Micro-Fit 3.0 2-pin (1: GND, 2: VCC)