In this example, a single uint8_t is set up to pass individual enumerations, (LED_CMDS), defining the state of one LED at a time or all of the LEDs (on/off). Here's a summary of what is covered in this example:
- ledCmdQueue: A queue of one-byte values (uint8_t) representing an enumeration defining LED states.
- recvTask: This task receives a byte from the queue, executes the desired action, and immediately attempts to receive the next byte from the queue.
- sendingTask: This task sends enumerated values to the queue using a simple loop, with a 200 ms delay between each send (so the LEDs turning on/off are visible).
So, let's begin:
- Set up an enum to help us describe the values that are being passed into the queue: ...