External Links

Creative Science Centre

 

Colour LEDS

WS2811/2

This I think is the more popular type, here is a driver that can sit on any port.

// #include "http://www.byvac.com/mBlib/flb/Library/2016/lib_ws281_1.bas"

The driver must be supplied with an array that is +9 bigger then the number of leds on the strip.

  • nx.init(*leds()*port(),nleds) - initialises the driver

Example

60 leds on port B0:

dim leds(69) // + 9 more then the number of leds
nx.init(*leds(),*RB0(),60)

  • nx.clr(*leds(),colour) // sets all of the leds to a given colour

Example

nx.clr(*leds(),nx.rgb(10,40,20))
nx.clr(*leds(),WHITE)

  • nx.pixel(*leds(),led,colour) // sets a single led to a colour, leds starts at 0
  • nx.rgbvol(rgb,brightness#) // adjust brightness of the colour

Example

The brightness is a floating point number from 0 (off) to 1 full brightness. It adjusts a colour number which in turn will effect the led.

nx.clr(*leds(),nx.rgbvol(WHITE,0.1))

 

Multiple strips on different pins

This is possible and practical to use multiple pins for a larger display, the BiG display in projects uses 8 strips of 40 leds connected to 8 pins.

Each pin needs it's own data array

Example

dim strip1(69), strip2(69), strip3(69)
nx.init(*strip1(),*RA0(),60) // pin 0 on port A
nx.init(*strip1(),*RA1(),60) // pin 1 on port A
nx.init(*strip1(),*RA2(),60) // pin 2 on port A

Use the functions above, specifying the correct strip.