B21ATTENUATOR
The task
R1 and R2 form a divider: CH1 gets half of what P0 puts out. C1 smooths the PWM.
P1 ticks every 40 cycles. Alternate CH1 between 1 volt and 2 volts, one level per tick.
The board
- Resistors
- R1 1 kΩ and R2 1 kΩ
- Capacitors
- C1 2.2 µF
- Probes
- CH1
Key idea
Without the divider, 1 volt would take 20 percent duty. With it, it takes twice that.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
A duty of 100 percent gives 2.5 volts on CH1, the most it can reach.
Hint 2Show
Sleep, set the duty to 40, sleep, set it to 80.
Solution
Reveal the Full SolutionThe complete program for ATTENUATOR. 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.
1 volt and 2 volts behind a divider that halves the output.
u1SC-2 standard
IN P1
MOV A, 40
OUT P0
IN P1
MOV A, 80
OUT P0- CYCLES
- 28
- at par
- ENERGY
- 56
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 6
- at par