I think Joe has been out drinking with some friends. At least he landed us the fourth deal. We are to make an animated esports sign for one of the famous stars in the world.

The board has 5 simple outputs and we are supposed to generate signals that looks like

The challenge with this one is definitely the number of outputs that we need to control. I have found two different solutions for this. There is the “bruteforce” way and then there is something a little more clever.

## The straight forward solution

For making the animated esports sign we will need three micro controllers of the MC4000 type to have enough outputs. Let us use one to tackle the clicks.

If we wire click-0 to p0 and click-1 to p1. Then we can solve it with the following piece of code

move 100 p0 move 0 p1 slp 1 move 0 p0 move 100 p1 slp 1

and that’s it for the clicks. For the drinks we need to think a little bit. Both drink-0 and drink-2 have 1 sleep part and one awake part. Where as drink-1 has 2 of each to make a full cycle. So I think we need to dedicate 1 controller to drink-1 and have drink-0 and drink-2 share one mc4000. So let me wire up a controller to with drink-0 to p0 and drink-2 to p1 and use the code

move 100 p0 slp 6 move 0 p0 slp 1 move 100 p1 slp 2 mov 0 p1 slp 1

For the last part we will wire drink-1 to p0 on the last micro controller and use the code

move 0 p0 slp 6 move 100 p0 slp 1 move 0 p0 slp 2 mov 100 p0 slp 1

Which all in all gives us this solution for the problem.

The results is

**Cost: 9
**

**Power usage: 206**

**Lines of code: 22**

We can do better than that

## Optimizing the Animated Esports Sign

If we start by taking a look at the clicks. We can see that they always alternate. So we should just generate one pulsing signal using the **gen **command and then use a LC70G04 not-gate to invert the signal to one of the clicks. That increases the cost, but it lowers the number of lines of codes as well as the energy consumption.

Looking at the drink part. We can see that drink-1 is high exactly when none of drink-0 and drink-2 are high. That should be solveable in logic as well.

What we have is the following logic table

drink-0 | drink-2 | drink-1 |

0 | 0 | 1 |

1 | 0 | 0 |

0 | 1 | 0 |

1 | 1 | – |

The last case is undetermined. Hunting for that logic gate in the instruction manual gives us an inverted xor or a nor gate (since the last case is undetermined we can use either). So let us use an LC70G86 and connect the input to p0 and p1 of the mc4000 and the inverted output to drink-1.

Then we can program it with two lines of code to be a little clever

gen p0 6 1 gen p1 2 1

Resulting in the following setup

The result is

**Cost: 8
**

**Power usage: 126**

**Lines of code: 3**

So a reduction on all three parameters. Especially the lines of code have been reduced significantly and the power consumption almost halfed. So I am satisfied!

For the straight forward solution I had a slightly shorter but higher power click solution:

mov acc p1

not

mov acc p0

slp 1