pxt-calliope/sim/state/neopixel.ts
2016-09-13 13:09:02 -07:00

14 lines
386 B
TypeScript

namespace pxsim {
export function sendBufferAsm(buffer: Buffer, pin: DigitalPin) {
let b = board();
if (b) {
let np = b.neopixelState;
if (np) {
let buf = <Uint8Array[]>(<any>buffer).data;
np.updateBuffer(buf, pin);
runtime.queueDisplayUpdate();
}
}
}
}