Fake Surveillance Camera

2022-02-13

Part of my journey through Shenzhen I/O

Problem: Use two MC4000s to light up an "active" and "network" LED on a fake surveillance camera according to the timing sequence provided.

This is a fairly straightforward challenge. The "active" LED is on for 6 cycles and off for 6 cycles:

  mov 0 p0
  slp 6
  mov 100 p0
  slp 6

The "network" LED is off for 4 cycles, on for 2 cycles, and then blinks on and off for one cycle each before repeating:

  mov 0 p0
  slp 4
  mov 100 p0
  slp 2
  mov 0 p0
  slp 1
  mov 100 p0
  slp 1

Cost is ¥6, power usage is 60, and 12 lines of code are necessary.