You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike pxt-common-packages, there's no way to query a color of a specific pixel.
"In circuit playground, you have a block "pixel color at 0" which returns the colour of that light. Is this block available in micro:bit for strips that you add on? e,g. I want to know what colour light 4 is in my RGB strip?"
function getLedValues (led: number) {
// Get the current values for all leds
let current_buff = strip.buf
// Break up the buffer into chunks, each corresponding to an LED
let chunked_buff = current_buff.chunked(3)
// Get the Value requested
let current_value = chunked_buff.get(led)
// ENHANCEMENT: Return in different/requested format
// Returns: array of [green],[red],[blue] values, but could also return an int, string, or ...
return current_value.toArray(NumberFormat.UInt8LE)
}```
CDEguia
added a commit
to CDEguia/pxt-neopixel
that referenced
this issue
Nov 3, 2024
Unlike pxt-common-packages, there's no way to query a color of a specific pixel.
"In circuit playground, you have a block "pixel color at 0" which returns the colour of that light. Is this block available in micro:bit for strips that you add on? e,g. I want to know what colour light 4 is in my RGB strip?"
User request:
https://twitter.com/LMcUnderwood/status/1006204237834018816
The text was updated successfully, but these errors were encountered: