How to animate a butterfly using Teensy, Octo and other stuff

Status
Not open for further replies.

mummyboy

Active member
In my cube of LEDs I'd like to create a butterfly animated in LEDs. Im not certain the resolution will be high enough to get much of anything but even abstractly it'll be a nice bit o candy, me thinks. I found the following fairly simple code to help me begin View attachment flying_butterfly.c but it features a bunch of libraries which are not part of the Arduino IDE:

#include<graphics.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>

I'm guessing most of the i/o stuff can simply go away and the graphics routine can be largely replaced by Adafruit_GFX. I'm wondering if anyone has guidance or other useful ideas to help me think about this problem or can otherwise direct me to other open code implementations.


Thanks

mummyboy
 
stdio.h and stdlib.h are, to the best of my knowledge, fairly standard libraries and are usually available on any platform you can get a C compiler for.

Quick review of 'flying_butterfly.c' gives me the impression that it is for platforms structured like PCs, the std*.h and conio.h references can be dropped because it is hardly like you are going to exit the program on Teensy by other method than simply de-powering it and if you did want a button (or buttons) there are more straightforward ways to have them in an embedded situation - I am not positive but I think the flying_butterfly.c source could lose the stdlib.h reference because they are not using any functions from it that I noticed (pretty sure conio.h has kbhit() and getch() but not positive it doesn't itself rely on stdio.h)

Aside from basic concept I don't think anything from that example is usable in your project; what I mean by that is that you would be better off to ignore the source code itself, look instead at the result on a PC display, figure out how to construct as near a simile of their result as you can using your target platform and available libraries for it.

hmmm, sorry, maybe this isn't as helpful as I thought it would turn out when I typed my first line of this reply.
 
Status
Not open for further replies.
Back
Top