pxt-calliope/sim/state/neopixel.ts

14 lines
386 B
TypeScript
Raw Normal View History

2016-08-30 20:51:32 +02:00
namespace pxsim {
export function sendBufferAsm(buffer: Buffer, pin: DigitalPin) {
let b = board();
if (b) {
let np = b.neopixelState;
if (np) {
2016-09-13 22:09:02 +02:00
let buf = <Uint8Array[]>(<any>buffer).data;
np.updateBuffer(buf, pin);
2016-08-30 20:51:32 +02:00
runtime.queueDisplayUpdate();
}
}
}
}