B84RETRIGGER
The task
P0 reads bursts of short pulses on CH1. Sample it on each tick of P2.
Light the LED on P1 while the input is high, and keep it lit until 4 ticks pass with it low.
Every high tick starts the 4 again, so the LED rides through short gaps.
The board
- Sources
- V1 1 V square at 12.5 Hz and V2 2.5 V square at 83.33 Hz
- Resistors
- R1 330 Ω
- LEDs
- D1 red
- Probes
- CH1 and CH2
Key idea
Keep the ticks left in B: a high sample sets it to 4.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
A low sample counts B down; when it reaches zero, the LED goes out.
Hint 2Show
Once B is zero, a low sample needs no write at all.
Solution
Reveal the Full SolutionThe complete program for RETRIGGER. Open it only when you want the answer.
The reference program
The game's own solution. It passes every test and scores exactly par on every benchmark.
A retriggerable hold of 4 ticks.
u1SC-2 standard
L: IN P2
IN P0
JZ DEC
MOV A, 4
JMP S
DEC: MOV A, B
JZ L
SUB 1
S: MOV B, A
OUT P1- CYCLES
- 505
- at par
- ENERGY
- 1010
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 10
- at par