Dear friends,
I`ve spent 4 hours to learn how to make something that resembles an sd log. I would like it to write data every 15 sec, but wherever I plug a delay node, it stops writig anything on sd. Where to plug a delay node?
The second question is how to make it write not in one slot of a csv file, but that one is for later))
You could use a buffer to store previous “light” value, then compare to current value. Do you want it to write every time “light” changes, or only if light has changed & we are at 15 sec ‘tick’, or only when light changes after at least 15 sec since last write?
Assuming the latter, you could use delay instead of clock for 15 sec timing. If delay-ACT is not active and old/new values of light are different, then pulse the ssd-log-W pin. The same pulse will also need to got through a defer node, then loop back to reset delay timer and update buffer with new value.
You may want to round the “light” value before storing to buffer or comparing to buffer; otherwise it is a change from 0.5 to 0.5000000001, and output will probably just show 0.50 for both values.
This should write after 15 seconds from previous write as soon as light value is more than 0.1 different from value of last write. I did not include nodes to generate strings to write…you already had that part.