@@ -11,8 +11,8 @@ The landing page for the _aolibs_ is on
1111## Introduction
1212
1313Library _ aoapps_ is a library with reusable "apps" for OSP chains.
14- Multiple apps form one firmware image ( or executable) for the ESP32
15- as explained below.
14+ Multiple apps form one _ firmware image _ or _ executable _ for the ESP32
15+ as explained below.
1616
1717
1818![ aoapps in context] ( extras/aolibs-aoapps.drawio.png )
@@ -23,7 +23,7 @@ that exposes a `step()` function, which is constantly called from the
2323main loop, and which manages the animation implemented by the app.
2424
2525In addition to the apps, this library also contains an _ app manager_ .
26- A top-level sketch includes the manager and registers one or more apps,
26+ A sketch includes the manager and registers one or more apps,
2727either from this library or from elsewhere (self developed). Typically
2828the "A" button on the OSP32 board is used to tell the app manager
2929to switch from one app to the next.
@@ -70,22 +70,28 @@ void loop() {
7070
7171This library comes with the following examples.
7272You can find them in the Arduino IDE via
73- File > Examples > OSP ReusableApps aoapps > ...
73+ [ File > Examples > OSP ReusableApps aoapps > ...] ( examples ) :
7474
7575- ** aoapps_switch** ([ source] ( examples/aoapps_switch ) )
76- This demo implements an application with two (dummy) apps.
76+ This demo implements an executable with two (dummy) apps,
77+ App1 and App2, which are part of the example.
7778 By pressing but A, the user can switch between the apps.
7879 The name of the active app is shown on the OLED.
7980 The green and red signaling LED show heart beat and error.
8081 App1 shows how to process button presses.
8182 App2 goes into error after a while (to show that the green heart beat
8283 LED stops and the red error LED switches on).
8384
84- - ** aoapps_runled** ([ source] ( examples/aoapps_runled ) )
85+ - ** aoapps_runled** ([ source] ( examples/aoapps_runled ) )
8586 This demo shows how to run an app.
8687 It uses the "runled" app, which has been made to expose its internals;
8788 the start, step and stop function.
8889
90+ - ** aoapps_sensors** ([ source] ( examples/aoapps_sensors ) )
91+ This is a template for a sketch using multiple apps and the app manager.
92+ It contains two apps ("runled" and "sensors"). The "A" button switches to
93+ the next app. For simplicity the command interpreter has not been added.
94+
8995
9096## Module architecture
9197
@@ -114,12 +120,12 @@ This library contains several modules, see figure below (arrows indicate `#inclu
114120 - The goal is to show that various OSP nodes can be mixed and have color/brightness matched.
115121
116122- ** aoapps_swflag** (` aoapps_swflag.cpp ` and ` aoapps_swflag.h ` ) is one of the stock apps.
117- - Shows one (static) flag at a time, eg the Dutch national flag red/white/blue spread over the OSP chain.
118- - Tries to find a SAID with an I2C bridge with an I/O-expander ( with four buttons and four indicator LEDs) .
119- - If there is no I/O-expander , shows four static flags switching on a time basis.
120- - If there are multiple I/O-expanders the first one is taken.
121- - When an I/O-expander is found the four buttons select which flag to show.
122- - The indicator LEDs connected to the I/O-expander indicate which button/flag was selected.
123+ - Shows one (static) flag at a time, e.g. the Dutch national flag red/white/blue spread over the OSP chain.
124+ - Tries to find a SAID with an I2C bridge with a "selector", an I/O-expander with four buttons and four indicator LEDs.
125+ - If there is no selector , shows four static flags switching on a time basis.
126+ - If there are multiple selectors the first SAIDbasic one is taken, or the first SAIDsense when no SAIDbasic .
127+ - When a selector is found the four buttons select which flag to show.
128+ - The indicator LEDs indicate which button/flag was selected.
123129 - The X and Y buttons control the dim level (RGB brightness).
124130 - This app adds a command to configure which four flags will be shown.
125131 - The goal is to show a "sensor" (button) being accessible from the root MCU (the ESP).
@@ -146,6 +152,32 @@ This library contains several modules, see figure below (arrows indicate `#inclu
146152 - Note, the tool [ eepromflasher] ( https://github.com/ams-OSRAM/OSP_aotop/tree/main/examples/eepromflasher )
147153 allows flashing EEPROMs with the various animation scripts.
148154
155+ - ** aoapps_sensors** (` aoapps_sensors.cpp ` and ` aoapps_sensors.h ` ) is one of the stock apps.
156+ - Measures the temperature using an AS6212 temperature sensor.
157+ - Measures the angle of the knob using an AS5600 rotary sensor.
158+ - Measures the light intensity using an SFH5721 ambient light sensor.
159+ - Only one of the three sensors is active at one time.
160+ - To change the active sensor, either press the X button to cycle to next,
161+ or press one of the selector buttons TEMP, ROTARY, ALS (and EXT) on
162+ the SAIDsense board.
163+ - The indicator LED (paired with the selector button) of the active
164+ sensor switches on.
165+ - The quad 7-segment display shows the readout of the active sensor.
166+ - When the temperature sensor is active, the OSP chains shows a red part
167+ and a blue part that change with temperature.
168+ - When the angle sensor is active, the knob angle (0-360) determines how
169+ many triplets are yellow (0..num triplets).
170+ - When ambient light sensor is active, the higher the ambient light level,
171+ the greener the triplets.
172+ - This app is written for the SAIDsense board.
173+ - For backward compatibility with older board, this app supports a board
174+ without light sensor, rotary sensor, or selector.
175+ - The Y button scrolls the type number of the sensor.
176+ - The X button toggles between temperature, angle or light sensor being active.
177+ - Upon a press the display shows the units for a short moment.
178+ - Active sensor has its indicator LED on.
179+ - Goal is to show a sensor can be used in OSP (eg for climate control, light adaption).
180+
149181
150182## API
151183
@@ -212,14 +244,15 @@ so desired). This handler allows the user manage apps.
212244
213245- ` aoapps_runled_start() ` , ` aoapps_runled_step() ` , ` aoapps_runled_stop() `
214246 are external, making it easier to demo this app without the manager.
247+ For the other apps these functions are kept private.
215248
216249
217250### aoapps_swflag
218251
219252- ` aoapps_swflag_register() ` registers the swflag app with the app manager.
220- - ` aoresult_t aoapps_swflag_resethw()` resets the I/O-expander , thereby
221- switching off the indicator LEDs attached to it. This helps reset the PCB
222- state when the MCU is reset.
253+ - ` aoapps_swflag_resethw() ` resets the selector , thereby
254+ switching off the indicator LEDs attached to it.
255+ This helps reset the PCB state when the MCU is reset.
223256
224257
225258### aoapps_dither
@@ -232,6 +265,14 @@ so desired). This handler allows the user manage apps.
232265- ` aoapps_aniscript_register() ` registers the aniscript app with the app manager.
233266
234267
268+ ### aoapps_sensors
269+
270+ - ` aoapps_sensors_register() ` registers the sensors app with the app manager.
271+ - ` aoapps_sensors_resethw() ` resets the selector and the quad 7-segment display,
272+ thereby switching off the LEDs attached to them.
273+ This helps reset the PCB state when the MCU is reset.
274+
275+
235276## Execution architecture
236277
237278To keep execution architecture simple, top-level sketches employ a
@@ -342,7 +383,6 @@ the `boot.cmd` which is executed at startup, for example:
342383`apps config sw set dutch mali europe italy`.
343384
344385
345-
346386## The voidapp
347387
348388The app manager has one app always registered, the "voidapp". This app
@@ -361,6 +401,12 @@ of the OSP chain, without app telegrams interfering.
361401
362402## Version history _aoapps_
363403
404+ - **2025 September 17, 0.4.0**
405+ - Updated documentation.
406+ - `aoapps_swflag.cpp` switched to new driver `aomw_iox4b4l`; it also supports selector SAIDsense (next to the one on SAIDbasic).
407+ - Added module `aoapps_sensors` (to be used with the SAIDsense demo board) and example `aoapps_sensors.ino`.
408+ - Added link to examples.
409+
364410- **2025 March 3, 0.3.0**
365411 - Added the feature that an app can be hidden; the `hide` commands toggles.
366412 - The voidapp no longer is hardwired hidden; it uses the new hidden feature.
0 commit comments