tom-2015 / rpi-ws2812-server

Raspberry Pi WS2812 (web) server tool
172 stars 39 forks source link

Chase sequence? #31

Open jschuenke1 opened 4 years ago

jschuenke1 commented 4 years ago

Is it possible to create a sequence in a loop where the addressed LED advances? I'd like to start at 0 and pulse LED up/down and then move to LED 1 and pulse up/down, etc to an end point of say 50 LED's.

I need a way to address led 1, then 2, then 3, etc. i don't see how to do this in your commands.

jschuenke1 commented 4 years ago

OK so I see how to address particular LED's using the fill command. Is there a way to make the startLED a parameter so it can be incremented in a do loop?

tom-2015 commented 4 years ago

not at this moment unfortunately if you don't have too much LEDs you can just copy/paste I think

tom-2015 commented 4 years ago

you can do this now with {0} which will be replaced by loop index and extra parameter can be added to the loop = step.

do
     fill 1,FF0000,{0},1
loop 10,2

this is the same as:

for (i=0;i<10;i+=2){
     fill 1,FF0000,i,1
}

if you have a nested loops you can increase the {0} to {1}:

do
    do
          fill 1,FF0000,{1},1
    loop 10,2
loop

To create complicated animations it's better to run the ws2812svr as a system service listening on a TCP port and send commands to it with external program like python,C# or shell script.

Create png files with each pixel the color for the led you want and load them with the readpng command in a loop is another possibility. The newest version can read entire png/jpg files with a delay between rendering each pixel line.

jschuenke1 commented 4 years ago

Thanks! I will give it a try.

Jeff Schuenke Senior Director of Software Development

M: 415 601 0860<tel:(415)%20601-0860> | @: jschuenke@viscira.com Viscira, LLC | 909 Battery Street | San Francisco, CA 94111https://maps.google.com/?q=901+Battery+Street+%7C+San+Francisco,+CA+94111&entry=gmail&source=g

From: Tom notifications@github.com Reply-To: tom-2015/rpi-ws2812-server reply@reply.github.com Date: Thursday, December 26, 2019 at 6:54 AM To: tom-2015/rpi-ws2812-server rpi-ws2812-server@noreply.github.com Cc: Jeff Schuenke JSchuenke@viscira.com, Author author@noreply.github.com Subject: Re: [tom-2015/rpi-ws2812-server] Chase sequence? (#31)

EXTERNAL EMAIL: This email originated from outside of Viscira. Do not click links or open attachments unless you recognize the sender and know the content is safe.

you can do this now with {0} which will be replaced by loop index and extra parameter can be added to the loop = step.

do

 fill 1,FF0000,{0},1

loop 10,2

this is the same as:

for (i=0;i<10;i+=2){

 fill 1,FF0000,i,1

}

if you have a nested loops you can increase the {0} to {1}:

do

do

      fill 1,FF0000,{1},1

loop 10,2

loop

To create complicated animations it's better to run the ws2812svr as a system service listening on a TCP port and send commands to it with external program like python,C# or shell script.

Create png files with each pixel the color for the led you want and load them with the readpng command in a loop is another possibility. The newest version can read entire png/jpg files with a delay between rendering each pixel line.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/tom-2015/rpi-ws2812-server/issues/31?email_source=notifications&email_token=ABVIDZTNTA7CLXTHDWT4AI3Q2TAQVA5CNFSM4JG6NRC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHVVOHY#issuecomment-569071391, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABVIDZRYUWM7KETYGGGOVATQ2TAQVANCNFSM4JG6NRCQ.