# BITBANG BITSTREAM | WS2812

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
BITBANG BITSTREAM pinno, n_transitions, array%()
BITBANG WS2812 type, pin, colours%()

Description:

BITBANG BITSTREAM pinno, n_transitions, array%()
This command is used to generate an extremely accurate bit sequence on the pin specified.
The pin must have previously been set up as an output and set to the required starting level.
The array contains the length of each level in the bitstream in microseconds. The maximum period allowed is 65.5 mSec
The first transition will occur immediately on executing the command.
The last period in the array is ignored other than defining the time before control returns to the program or command line.
The pin is left in the starting state if the number of transitions is even and the opposite state if the number of transitions is odd.

This is equivalent ot the bigbang Cfunction for the micromites.

BITBANG WS2812 type, pin, colours%()
This command outputs the required signals to drive one or more WS2812 LED chips connected to 'pin'.
Note that the pin must be set to a digital output before this command is used.
'type' is a single character specifying the type of chip being driven:
O = original WS2812
B = WS2812B
S = SK6812
The 'colours%()' array should be an integer array sized to have exactly the same number of elements as the number of LEDs to be driven.
Each element in the array should contain the colour in the normal RGB888 format (ie, 0 to &HFFFFFF).

Last edited: 29 September, 2020