LED Bar (DS1101, DS1102, and WS1102)

The DS1101, DS1102, and WS1102 feature an LED bar comprised of five blue LEDs. The bar can be used for signal strength indication and other purposes.

Note: The green, red, and yellow status LEDs, which are present on all DS/WS110x devices, are described in the Status LEDs topic.

ds-ws110x_led_bar

DS1101 and DS1102

On these devices, each of the five LEDs is connected to a dedicated GPIO line of the CPU:

GPIO line

LED

PL_IO_NUM_23_SB5

LED5 (top, the strongest signal)

PL_IO_NUM_22_SB4

LED4

PL_IO_NUM_21_SB3

LED3

PL_IO_NUM_20_SB2

LED2

PL_IO_NUM_19_SB1

LED1 (bottom, "the lowest signal"

To turn an LED on, enable the corresponding I/O line (io.enabled = 1 — YES) and set this line LOW (io.state = 0 — LOW). Hint: these are properties of the io. object (see the TIDE, TiOS, Tibbo BASIC, and Tibbo C Manual).

WS1102

On this wireless controller, the LEDs are controlled via Microchip's MCP23008 I/O expander IC. The I²C interface of this IC is connected to GPIO lines 5 and 6 of the WS1102's CPU, as shown in the diagram below.

ws1102_led

Use the ssi. object (see the TIDE, TiOS, Tibbo BASIC, and Tibbo C Manual) to communicate with the MCP23008.

To turn an LED on, configure the corresponding line of the IC as an output and set it LOW. Refer to the MCP23008 datasheet for information on how to achieve this.

The WS1102 is fully supported by CODY, Tibbo's project code wizard. CODY can generate the scaffolding for your WS1102 projects, including the code to control the LED bar.