extension

The challenge now is to extend your network to support 3 LEDs.

You can use three fader() processes; that's not a problem. Note, though, that there is only one adc() process. The reason for this should be obvious: there's only one slider.

You need to write a process that lives in-between the ADC and the fader processes; it should handle requests from the three faders (each of which may request a reading at any time), do the reading, and then send the result back to the fader who made the request. This will combine the Client/Server and Multiplexer patterns.

I'm scaffolding this less than previous parts, because I want you to dig into the design of this process a bit on your own. It won't be a long process, but it does contain some big ideas.

QUESTIONS

  1. What is a semaphore?

  2. Is your new PROC the process-oriented equivalent of a semaphore? 
    Why or why not?
Creative Commons License This work is licensed under a CC BY-SA 3.0 License.