-
Notifications
You must be signed in to change notification settings - Fork 129
support for LED driver + simulation #580
Conversation
| * @param startColor | ||
| * @param endColor | ||
| */ | ||
| export function fillGradient( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these fills and rainbows should be methods on the PixelBuffer, otherwise they are rather hard to discover
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to avoid to turn pixelbuffer into a monster
| * Create a color buffer that allows you to manipulate a range of pixels | ||
| * @param numPixels number of pixels | ||
| */ | ||
| export function pixelBuffer(numPixels: number) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this probably should be PixelBuffer.alloc() to follow Buffer.alloc()
| if (this._gamma) correctGamma(r, this._gamma) | ||
| b = r | ||
| } | ||
| // TODO: render b to hardware |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmoskal this is the part missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not anymore :) https://github.com/microsoft/devicescript/blob/main/packages/drivers/src/ledserver.ts#L159 - added it a couple days ago
Support for driving programmable LEDs.
The jacdac-docs is already deployed and the
mainled.tsworks in the simulator.