Ws2812!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Ws2812!

Post by jgu1 »

Hi All!

I am playing around with the WS2812 strip led. I also managed to get it work, by adjusting color via potentiometer from the example from help in component, nice. But is it possible in FC8 to control the led something similar like this: https://www.youtube.com/watch?v=EcMKditEVtY
by using the macro component. I have try different setting with the shift component, but no luck.

Have any here experience with this, please. :D

Br Jorgen
Attachments
WS2812_test.fcfx
(16.34 KiB) Downloaded 223 times

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Ws2812!

Post by mnf »

Hi Jorgen,

What effect are you trying to achieve? - You are shifting a single colour strand of leds whilst keeping the last value as is (try using ShiftLEDS1d(1,0)?)

Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Ws2812!

Post by jgu1 »

Hi Martin!

Thank´s for fast reply.

Is it possible to turn on and off single led. Let maybe two led "run forward and back again, on and off one led at the time, some fun like in the Utube :wink: Hope it make sence.

Br jorgen.

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Ws2812!

Post by mnf »

Yes,

Use setledcolour(led, r,g,b)

I'm finding the brightness setting a bit odd - I need to use setbrightness(0.1) - but I'm just playing with loading images from an eeprom chip, so really need a setcolour that doesn't use brightness. I have a scroll image in - will try post a video...

Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Ws2812!

Post by jgu1 »

Ok, Martin, But how is it possible to to let the led shift by using the setcolor? Concerning the brigthness I am agree But you can also use the other compmarco 0 - 255 you know of course.

In my opinion, we miss some of the benefits as you made in the max7219 component. :roll: (I still use it).

Would be nice to make some fun with the WS2812 like in the video, utube.

Look forward to see your video.

Br Jorgen

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Ws2812!

Post by mnf »

Hi Jorgen,

https://youtu.be/n9Q56mYRpAQ

Need to add some better bitmaps ( and a way to transfer then via UART from pc to Arduino....) Wet and very windy here today so might manage something.

Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Ws2812!

Post by jgu1 »

Ok, Martin, these ws2812. I am using the strip like in the link I added. :D
But anyway, nice project you have.

Br Jorgen

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Ws2812!

Post by mnf »

The grid is just a strip really.. 256 leds in a folded form...
The one I have is just that - so the pixels go left to right then right to left....

So the principles are the same.... So to do a rainbow effect - pull the colors from the wheel macro.. (I got this from an adafruit demo!)

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Ws2812!

Post by mnf »

So (for example) a rainbow scroll modded to 1d...
Rainbow.fcfx
(15.91 KiB) Downloaded 233 times

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Ws2812!

Post by jgu1 »

Thank you Martin. I will play with your program :D

Br Jorgen

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Ws2812!

Post by mnf »

Did you get it to work?

Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Ws2812!

Post by jgu1 »

Hi Martin!

Yes I Do, Sorry for late reply. Meanwhile I am in holyday
I Africa.
Yes and it work very nice. :wink: When I come back I Will play
Some more with your examble. What would be Nice is still
To be able to control control each led. Turning on and OFF
Just like some nigthridereffect, and running effect :D

Written on my Iphone.

Br Jorgen

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Ws2812!

Post by mnf »

Hi,

Enjoy your break...

As for KITT - should be doable. Use SetLEDColour to work with individual LEDs.
You can also use GetLEDColour - to 'look' at the current R,G or B value of an LED - but scaling does make life more difficult.
It would be very nice if the buffer contained the 'actual' colour values and scaling was only applied as the data was written out to the LEDs (good luck - esp on Arduino :) )
We'll need sound too (and some sound clips - 'Not now Michael'?)

Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Ws2812!

Post by jgu1 »

Well, well, ok Martin, this is the way, it make sense. As soon I am home again from holyday, I will make a test, thank you very much.

Br Jorgen.

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Ws2812!

Post by MJU »

Strange, I was playing with the WS2812B just last week.
I saw that there was an update for the component, and I've updated it.
Since a few days my W2812B ledstrip doesn't work anymore...

Is there a problem with the new component of is my (waterproof) ledstrip gone bad?

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Ws2812!

Post by jgu1 »

Hi MJU!

I have test Martin’s program 10’th Dec. and it was after update, work fine.. Remember, if you also try Mnf´s program, it is a WS2812, (without the B).

Br Jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Ws2812!

Post by jgu1 »

Hi Martin!

Now back from holyday. I follow your guide, and yes, as always it work. I am now able to control single led :lol: thank´s for help.

I att. a small testprogram. I am sure that there are many other way to make a similar program.

I will try to make an "icetap" you know a white tap where it look like the water run downstairs. Difficult :D

Thank´s

Br Jorgen
Attachments
RunningTest.fcfx
(15.25 KiB) Downloaded 148 times

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Ws2812!

Post by mnf »

Glad it works. Look forward to seeing the icetap (new to me) in action...

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Ws2812!

Post by jgu1 »

Well Martin, I managed to create something like a dripping icetap :D I am sure you can do it better, but it is a beginning.
When first I begin to get some experience with the WS2812 I see it is possible to do many funny thing :lol:

Br Jorgen
Attachments
Icatap.fcfx
(11.62 KiB) Downloaded 142 times

mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Ws2812!

Post by mnf »

Hi Jorgen,

Hope you had a good Christmas and New Year...

Just managed to try the program - cool effect - I 'stretched' it to the full 60 led strip and made it a bit brighter and faster. For your next trick - how about 'cycling' through a colour palette for the 'chasers' (do they have a proper name?) and a programmable 'gap' (in pixels) between them?? (multiple 'drops' across a longer string of LEDs)

Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Ws2812!

Post by jgu1 »

Hi Martin!

Yes, all well, hope the same for you.

I see your point :lol: and later I will play with it again. Meanwhile I started up again with a new project with you very good MAX7219 component.

The first project I use a DHT22 showing temperature and humidity and some funny text. Now I try to make a project with Max7219 where I implement
Martins (medelec35) program for the DS18B20 and a DS3231. It work with both component. Now I have to make some finish :wink: When it is end I share here.

Br Jorgen

Post Reply