Take the opportunity to make sure you are up to date with the exercises.
Your solutions won’t look quite like mine.
I do have a few years extra experience, so I’m applying lessons learnt. There is no ‘definitive right’ solution, a solution is good if
- it works
- satisfies any constraints
DigitalOut
my solutiongit checkout led-class
on the above repository (once you have a clone or fork)ispressed
git checkout button-class
wait
function to give the desired flashing frequency.
The Period is 1/frequency and the wait times are half that
red.on();
wait(0.5);
red.off();
wait(0.5);
red.on();
wait(0.05);
red.off();
wait(0.05);
red.on();
wait(0.6667);
red.off();
wait(0.6667);