Beginner's question

I can’t speak English, so I use translation software.
It may be strange English, but please forgive me.

I don’t understand the basics.
10 LEDs are lined up.
How do you fill in the program that lights only the 4th one?
Middle half. The first half is white. The second half is blue. How do you fill in the program to turn it on like this?

hsv(hue, saturation, value)
I understand that I use this command.
How do you specify a value that specifies the location of the LED?

What language do you speak?

YouTube might be able to translate this:

it’s Japanese
I will see it once.
thank you very much!

I watched the video.
I can understand the explanation of the video somehow,

10 LEDs are lined up.
How do you fill in the program that lights only the 4th one?
I don’t know

It may be that the understanding is wrong in the first place

hsv(hue, saturation, value)
Can I specify where to turn it on?

export function render(index){
  if (index == 4) {
   hsv(.5,1,1)
  } else {
   hsv(0,0,0)
  }
}

Perhaps a picture will help. This is a simplified explanation of what Pixelblaze is doing behind the scenes:

The usual way to write patterns for Pixelblaze is inside-out compared to the way you push pixel data to the LEDs with other systems like FastLED; Pixelblaze is more “object-oriented” in a sense. With Pixelblaze, the render engine runs in a loop doing its housekeeping and input/output work as fast as it can, and at the appropriate time it calls your beforeRender() and render() functions to let you calculate the pixel colors, which it then sends out to the string of LEDs.

So if you wish to set the color of a specific pixel, you would want to do it inside the render(index) function because that’s the only place you know which pixel is being rendered. And I’ll stop there because I see that @scruffynerf has just given you an example…

2 Likes

I was excited that you were posting a image until I realized it was a pile of text. Still thinking about how to convey how PB works just with pictures.

My goal this fall/winter is to teach newbies how to think in a PB way, and this certainly is part of that. Being able to visualize how it works is a good goal.

You could try using a “visual” programming language like Blockly or Flow UI, but I don’t think it will make things any clearer:

For a starting-from-zero introduction, there’s Human Resources Machine as an introduction to programming:

1 Like

Thank you very much.
I am very grateful.
The content is too difficult and I have to give up.

It’s fatal that I can’t speak English.
However, since I had a hint, I will study little by little.

1 Like

Thank you for your very meaningful advice.
Find a Japanese site and study.