Moth & Gravel · Kajo Lab 101
Your first replay in Kajo Lab
Open a real light-sensor recording. Find when a night light turns on, then change one number and see what would have happened with the same readings.
The desktop steps use the Windows Kajo Lab build. You can do all of them without a Pico or a compiler setup. If Lab is unavailable to you, use the browser exercise below.
Find the recorded switch
- Launch Kajo Lab. Choose Open recording or session… and select
Night-Light-Pico.capture. - In Signals, click the trace near 8.45 s. With focus on the trace, use the left and right arrow keys to move one observation at a time. An observation is one saved reading and its recorded decision.
- At 422, the input is 121 and Recorded Forth result is OFF (0). At 425, the input is 88 and the recorded result is ON (1).
The recording contains the command Kajo sent to the LED. The sensor measures light at the photoresistor.
Change one number
- Open Program → Forth and choose Recorded source. In Experimental Forth, change
DUP 92 U<toDUP 80 U<. Leave116alone. - Predict the result for input 88 at observation 425. The new rule turns on only below 80.
- Choose Compare full recording, then First mismatch. Read the two commands at observation 425. Recorded is ON (1) and experimental is OFF (0).
Replay uses the saved inputs and the edited rule. The recording still holds the original commands.
Test your prediction
These ten observations come from the capture. Both rules turn the LED off at 116 or above. Between the ON and OFF thresholds, the previous command carries forward.
| Observation | Input | Recorded | Replay |
|---|---|---|---|
| 421 | 134 | OFF | |
| 422 | 121 | OFF | |
| 423 | 109 | OFF | |
| 424 | 98 | OFF | |
| 425 | 88 | ON | |
| 426 | 92 | ON | |
| 427 | 89 | ON | |
| 428 | 85 | ON | |
| 429 | 80 | ON | |
| 430 | 76 | ON |
Why does replay stay off at input 80?
Below 80 leaves out 80 itself. The edited rule first turns on in this part of the recording at observation 430, where the input is 76. The original run had already turned on at 425.