I am developing teaching resources for kids 9 - 13.
I am using node-red because it is visual / low-code.
I want to create a flow that teaches transient vs persistent data storage.
I have a momentary button attached to a Raspberry Pi.
I have used contrib-counter to increment a value in the msg object based on presses of the button.
I call this the transient count.
I can illustrate that deploy or a node-red restart or a Raspberry Pi reboot, or a loss of power results in a reset of the value.
What I need now is the button press to continue with this transient count but also:
- Access a file containing the running total
- Increment by 1
- Update the file
- Display the running total in debug
That way, the learners can press the button, seeing the transient count starting at 1, and the running total at a higher number, restart node-red and see the impact on both numbers.
I am still learning node-red myself, and I just can't get my head around this.
However, I want to struggle to the solution, as that's the best way for me to learn.
So, can someone give me the tiniest nudge in the right direction?