Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

Background snow fall effect in CircuitPython
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Background snow fall effect in CircuitPython

by Azzura on Sat Dec 04, 2021 9:15 pm

Hi, Xmas is coming fast, seeking support for code to animate continuous background snow fall effect in CircuitPython.
I have built a frame to fit in my window that supports 4 panels each 64 X 32, installed, wired and tested ready to go. However my CircuitPython code skills are not as good as my wiring skills. I am finding it difficult to write CircuitPython code to animate continuous snow fall.
Eventually I wish to have Merry Xmas text scrolling across the snow fall effect, but at this time I need the snow fall code. Anyone care to share CircuitPython continuous snow fall code?

Azzura
 
Posts: 10
Joined: Mon Nov 29, 2021 9:20 pm

Re: Background snow fall effect in CircuitPython

by adafruit_support_carter on Mon Dec 06, 2021 2:12 pm

There's some code here that might help:
https://learn.adafruit.com/circuit-play ... snow-globe

adafruit_support_carter
 
Posts: 22219
Joined: Tue Nov 29, 2016 2:45 pm

Re: Background snow fall effect in CircuitPython

by Azzura on Mon Dec 06, 2021 7:56 pm

Hi, thanks for the quick reply, appreciate the advice on the snow globe using the "adafruit_circuitplayground/// cpx" coding proposal.

Question:
What is the difference using the adafruit_circuitplayground cpx coding concept rather than using the matrix = rgbmatrix.RGBMatrix display concept. Does the RGBMatrix coding strategy offer more options to coding than the adafruit_circuitplayground?

Azzura
 
Posts: 10
Joined: Mon Nov 29, 2021 9:20 pm

Re: Background snow fall effect in CircuitPython

by adafruit_support_carter on Mon Dec 06, 2021 8:00 pm

The OLED and the Matrix are both just displays. You'd need to adapt the code for use on the RGB Matrix. But you could reuse the snow generating parts of the code.

adafruit_support_carter
 
Posts: 22219
Joined: Tue Nov 29, 2016 2:45 pm

Re: Background snow fall effect in CircuitPython

by Azzura on Tue Dec 07, 2021 10:06 pm

Thank you, sometimes the jargon eludes me. However I am tenacious, I will try to adapt the code; I have not pulled all of my hair out yet, so I'll try the RGB Matrix coding.

Azzura
 
Posts: 10
Joined: Mon Nov 29, 2021 9:20 pm

Re: Background snow fall effect in CircuitPython

by adafruit_support_carter on Wed Dec 08, 2021 10:40 am

Start with examples that are for the RGB matrix. That'll help you become familiar with the basic way of displaying things on the matrix. And just using the matrix in general. Then move to trying to adapt the snow code for the matrix.

EDIT This may help also. It's a quick port I did a few months ago. It may still need some changes for your specific setup, but at least it provides some reference code that is driving an RGB matrix:
https://github.com/caternuson/MatrixPor ... ix_snow.py

adafruit_support_carter
 
Posts: 22219
Joined: Tue Nov 29, 2016 2:45 pm

Re: Background snow fall effect in CircuitPython

by Azzura on Wed Dec 22, 2021 1:26 am

Hi, really appreciated the advise on the coding and the direction to the examples ie, rain, snow etc. Used the snow example, amended the code to have a continuous snow fall event. Now I wish to add animations such as reindeer, mountains, trees etc in the falling snow. Any ideas?
Super helpful code it allowed me to get a handle on what I could achieve ... thanks

Continuous Snow fall by Carter.png
only needed the snow falling not the accumulation, so appreciative cheers
Continuous Snow fall by Carter.png (526.06 KiB) Viewed 157 times

Azzura
 
Posts: 10
Joined: Mon Nov 29, 2021 9:20 pm

Re: Background snow fall effect in CircuitPython

by adafruit_support_carter on Wed Dec 22, 2021 12:31 pm

If you want those things to be static, then it's easy - just add them as a new layer into the display group. The animated snow would then be a separate layer, essentially what you already have in place.

If you want them to actually be animated, it'll be more work. Do you want snow and other things to animate at different rates? etc.

This guide may be useful as a demonstration of how to do animations using "sprite sheet":
https://learn.adafruit.com/tombstone-ma ... on-display

adafruit_support_carter
 
Posts: 22219
Joined: Tue Nov 29, 2016 2:45 pm

Re: Background snow fall effect in CircuitPython

by Azzura on Fri Dec 24, 2021 8:58 pm

Hi, further to the sprite concept, I have played with them and yes it is a lot of work. In my mind the video I see is composed of fast images of snowfall then animated sprite image then snowfall then sprite image etc A bit like a video however the eye sees both images simultaneously not the rapid image changes. Is this practicle or is there a simpler concept available.

I really appreciate all of your feedback.

Azzura
 
Posts: 10
Joined: Mon Nov 29, 2021 9:20 pm

Re: Background snow fall effect in CircuitPython

by Azzura on Thu Jan 13, 2022 8:27 pm

Hi Carter, your continuous snow program is working great.

Snowfall rising from the ground:
I have 4 panels working now large rectangular format, and it is looking like a snow storm, ha ha. One problem is I need to tell the program that panels 3 and 4 have been rotated to make the wiring simple, but now I need to stop the snow from rising up from the ground. I believe the "serpentine" command needs to be incorporated into the matrix definition, just not sure how and where. Currently all snow is travelling to the middle of the 4 panels, very spectacular but somewhat surreal.
A hint would be appreciated.

Azzura
 
Posts: 10
Joined: Mon Nov 29, 2021 9:20 pm

Please be positive and constructive with your questions and comments.