0

simple sketch for running animations
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

simple sketch for running animations

by SMARTT on Fri May 17, 2019 12:53 pm

Hi all,

One of the reasons I became interested in the Adafruit Hallowing is that its text description says ". . . 8 MB of SPI Flash for storing images, sounds, animations, whatever!..." Well, I want to do simple animation.

Specifically, I bought several Hallowing boards last year for a feature in a scale model. Essentially, they will be TV monitors running color video clips. I do not even need the whole screen, my video will be sized/cropped to about 100 px x 55 px, full color. The rest of the screen will be behind a bezel.

I understand that these controllers are too simple for true video, but video frames broken out and resized as BMP files can work according to some of your forum responses. Basically, I have been looking for a while to find a way to play these pseudo videos on their little Hallowing modules. I would prefer to have a lot of images play before they repeat, rather than 5 or 10 frames.

So far, I have not found a project that gives the essential instructions. I can modify code, but I am not facile enough to write it from scratch yet. Is there a plug and play sketch I can upload that will allow me to have a continuous running animation from a set of BMPs?

I saw one area where the drag and drop nature of part of the chip/board environment was shown (I haven't been able to find that page again, D'oh!), but I did not see a specific sketch to accomplish what I discuss above. Dr. Google has been no help. :(

Perhaps someone could recommend a tutorial? an article? Some method to accomplish this with the Hallowing? with specific steps and code?

Thank you for your time!

SMARTT
 
Posts: 8
Joined: Fri May 17, 2019 11:18 am

Re: simple sketch for running animations

by franklin97355 on Fri May 17, 2019 3:41 pm


franklin97355
 
Posts: 20979
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: simple sketch for running animations

by SMARTT on Sat May 18, 2019 10:38 pm

Hi Franklin,

Thank for the response. I've actually read thru that article a few times. It's conceptually great and packed with features, but the overall thing is a bit intimidating. By making the program something for everyone, it becomes a rather convoluted road to travel.

I would really like a more basic application that does simply what I need, i.e. run an animation or if that's not compatible, flip a series of images fast enough to look like an animation. It's great that someone went to all that effort to introduce so many concepts at once, but a set of individual routines that could be assembled as needed would make a more educational experience for me.

I bought the Hallowing because its integrated screen and MPU would hopefully simplify the experience of doing what its sales text says it was designed to do. I was hoping that the community could direct me to a resource as I describe above --- simple code modules.

Thanks again.

SMARTT
 
Posts: 8
Joined: Fri May 17, 2019 11:18 am

Re: simple sketch for running animations

by kevinjwalters on Sun May 19, 2019 8:05 pm

I don't have a Hallowing to try this on but you could just see how a very fast slideshow performs? There's some very simple, concise code in Adafruit Learn: Getting Started with HalloWing for Hackaday Supercon Attendees: Slide Shows. You'd need to lower the dwell value, I'd try 0 or perhaps 0.1. And I think you want to add a fade_effect=False to get rid of the delay from that. For docs, see adafruit_slideshow.

kevinjwalters
 
Posts: 429
Joined: Sun Oct 01, 2017 3:15 pm

Re: simple sketch for running animations

by SMARTT on Tue May 21, 2019 10:24 am

OK. Got it to work, but slowly. Now I will need to tweak.

Thanks again

SMARTT
 
Posts: 8
Joined: Fri May 17, 2019 11:18 am

Re: simple sketch for running animations

by SMARTT on Tue May 21, 2019 3:37 pm

Well, I tweaked sizes and the space between frames in the render, 100px x 50 px works fine sizewise, but the setup can only refresh at a certain rate that seems to be about 1-2 FPS, which is way too slow for anything convincing even on a miniature.

I was looking more for something like this ... https://learn.adafruit.com/pyportal-ani ... y/overview designed for the PyPortal.

Any ideas on if this would work with the Hallowing?

Is there an SD card shield for the Hallowing to enable more still storage?

SMARTT
 
Posts: 8
Joined: Fri May 17, 2019 11:18 am

Re: simple sketch for running animations

by tannewt2 on Wed May 22, 2019 1:54 pm

The Hallowing is the slower SAMD21 (48 mhz) compared to the PyPortal which has a SAMD51 (120 mhz). Switching to Arduino will definitely speed things up but the SAMD21 won't be able to match the SAMD51.

The Adalogger FeatherWing should work with the Hallowing's feather header. Here it is on Adafruit but out of stock. https://www.adafruit.com/product/2922 Digikey has it though: https://www.digikey.com/short/p45z2z

Hope that helps!

tannewt2
 
Posts: 1266
Joined: Thu Oct 06, 2016 8:48 pm

Re: simple sketch for running animations

by SMARTT on Wed May 22, 2019 3:43 pm

Ok. Thanks for the info on the SD adapter.

Now, is there any program that I can get to do the gif anims? I bought 3 Hallowings and am long past the return period, and I want to use them.

Can the program I linked to be run on the Hallowing? Are the right libraries available? Even a slow gif animation at 40% of a 15 FPS gif would be better than a ridiculous 1-2 FPS on a quarter of the screen.

Perhaps I should ask the question from another angle . . . What kind of animation was the sales text describing when it discussed animations?

SMARTT
 
Posts: 8
Joined: Fri May 17, 2019 11:18 am

Re: simple sketch for running animations

by SMARTT on Fri May 24, 2019 12:25 pm

Anyone else have any ideas?

SMARTT
 
Posts: 8
Joined: Fri May 17, 2019 11:18 am

Re: simple sketch for running animations

by kevinjwalters on Fri May 24, 2019 6:10 pm

How is your C programming? There's example code for:

If the memory requirement for an image is 128*128*2 then that's the complete memory of the M0 so it's not going to work with full size images loaded in one go. I would start with some smaller ones (64x64?)and then see where it breaks as you increase it.

There's a full C/Arduino example reading gif files for PyPortal (has the faster M4 processor so remember the fps seen in the clip is unlikely to be achievable). I haven't looked at the code here and I'd be more tempted to start with multiple bmp files whilst trying to work out in parallel if gif library is feasible on the M0 Hallowing. It does mention that the on-board flash storage is quicker than if you added an extra, external board for SD card.


That should go faster than CircuitPython but I don't know what the bottleneck / rate-determining factor will be, possibly the disk space because you're unlikely to be able to hold multiple images in memory although if you're fortunate with libraries/hardware there might be some degree of pipelining with dma writes to the display...

kevinjwalters
 
Posts: 429
Joined: Sun Oct 01, 2017 3:15 pm

Re: simple sketch for running animations

by SMARTT on Sun May 26, 2019 4:08 pm

Hi Kevin,

Thanks for joining the discussion. Unfortunately, while I have programmed in the past, it is not in C or Python, so I need something that I can easily modify and that already basically works so I can experiment.

I believe that the link you cite to the pyportal is the same one I posted above. As I read the article, this could work for my purposes if it can be adapted to the hallowing. I would think that even at partial speed, it would be more effective than the slideshow software at zero delay as covered in the earlier post providing about 1 FPS even with sub 128x128 bmp files.

I do not know how compatible the py portal gif animation is with the hallowing board. I do not know if it accesses libraries that are not present or that would not work on the hallowing board.

I was hoping that someone has gotten actual animation to work on this board. No one seems to be fessing up to that yet.

Please keep the comments and ideas coming, especially if you have gotten hallowing to animate.

SMARTT
 
Posts: 8
Joined: Fri May 17, 2019 11:18 am

Re: simple sketch for running animations

by SMARTT on Tue Jun 11, 2019 8:35 pm

So no one has used Hallowing to animate? Disappointing. :(

SMARTT
 
Posts: 8
Joined: Fri May 17, 2019 11:18 am

Re: simple sketch for running animations

by Disciple on Wed Jun 12, 2019 5:57 am

Speaking as a mere hobbyist who doesn't have a HalloWing, "animation" is a flexible term in this community. About 75% of the time it means graphics in motion, as in blinky eyes and minotaur mazes, and 25% of the time it means video playback, as in the GIF viewer. My guess is the biggest performance boost will come from mastering the DMA functions described in the Spirit Board tutorial, which I have not yet done.
What I have done is beat my head against the BMP-reading code in the NeoPixel Painter project until it works on my Feather M0 and produces images on my NeoPixel matrix. It reads BMP sequences pretty quickly... the small ones that fit my matrix at least. My uneducated opinion is that the idea of showing BMPs from SD as video is doable, but some digging and experimenting will be required. That's all I got. Best of success.

Hallelujah!
Disciple

Disciple
 
Posts: 674
Joined: Tue Jan 06, 2015 8:13 pm

Please be positive and constructive with your questions and comments.