@dc42 The new RRF version lets me send 31 bytes, but for some reason, sending 34 bytes gives "Error: I2C transmission error". What's interesting is this is usually a fatal error, in that to get the NeoDriver working again requires a power cycle. In this case, it does not seem to interfere with subsequent I2C communications. 31 bytes (9 LEDs) didn't used to work; the best I could do was 28, meaning 8 LEDs (the data being in 3-byte multiples). Now 9 works fine.
In the code below, running with the "var RunCount = 9" changed to "var RunCount = 10" will produce a transmission error, and doesn't update the LEDs, but it doesn't lock up future communications; you can then change it back to 9 and it runs successfully with the desired result. The first 4 bytes of the buffer are overhead information, and the rest are "GRB" triplets, each representing one LED.
var I2CAddr = 0x60 var LED_COUNT = 28 var NeoBufSize = 3 * var.LED_COUNT var RunCount = 9 var BufSize = 4 + 3 * var.RunCount var Buf = vector(var.BufSize, null) set var.Buf[0] = {0x0E} ; base address in NeoDriver set var.Buf[1] = 4 ; Specifies sending a buffer set var.Buf[2] = 0 set var.Buf[3] = 0 ; Offset in NeoDriver internal buffer while iterations < var.RunCount ; Put individual R, G, & B values into Buf array set var.Buf[4 + iterations * 3] = 0 ; Green set var.Buf[5 + iterations * 3] = 0 ; Red set var.Buf[6 + iterations * 3] = 24 ; Blue ;----------------------------------------------------------------------- ; Send the data ;----------------------------------------------------------------------- M260 A{var.I2CAddr} B{0x0E, 1, 0x0F} ; NeoDriver "pin #" G4 P50 M260 A{var.I2CAddr} B{0x0E, 2, 1} ; NeoDriver I2C speed G4 P50 M260 A{var.I2CAddr} B{0x0E, 3, var.NeoBufSize, 0} ; Internal NeoDriver buffer size ;------------------------------------------------------------------------------- M260 A{var.I2CAddr} B{var.Buf} ; Sending buffer data ;------------------------------------------------------------------------------- ; G4 delays seem to prevent NeoDriver locking up with "I2C transmission error" ;------------------------------------------------------------------------------- G4 P100 ;------------------------------------------------------------------------------- ; Show NeoPixels ;------------------------------------------------------------------------------- M260 A{var.I2CAddr} B{0x0E, 5}