Electronic Animated Eyes for ARM Microcontrollers a guide on how to customize the images

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jazzmanny
 
Posts: 2
Joined: Mon Mar 13, 2023 10:51 pm

Electronic Animated Eyes for ARM Microcontrollers a guide on how to customize the images

Post by jazzmanny »

Hi, I am a newbie to this forum, but I am having a issue on how to use images that I have modified from the original files from the Uncanny_Eyes-master file folder and making them work or convert to the format that the computer likes. Edit the dragon iris image...using Photoshop or image editor of choice, there's usually an easy option to change the hue of things. Save as a PNG image...if it's in the same folder as the original, let's call it "myIris.png".

Then some command-line shell stuff. Make a copy of the dragonPupilMap.png image, call it pupilMap.png and put it in the same directory as the tablegen.py script, i.e.:
CODE: SELECT ALL

cd convert
cp dragonEye/dragonPupilMap.png pupilMap.png
Run the Python script to convert the images into something the eye code can use:
CODE: SELECT ALL

python tablegen.py dragonEye/sclera.png dragonEye/myIris.png dragonEye/upper.png dragonEye/lower.png -80 > foo.h
The Python stuff's all pretty simple on Mac or Linux, since it's built-in...couldn't tell you how it's done in Windows, but I'm sure it's a thing and some Googling would turn something up.

Copy the resulting header file (foo.h) to wherever the Arduino code is located, then run the Arduino IDE and open the uncannyEyes sketch. Or if the IDE is already running, create a new tab and copy-and-paste the .h file's contents there.
Edit the top of the Arduino sketch to use the new eye (comment out whatever one's currently enabled, replace it with this):
CODE: SELECT ALL

#include "foo.h" // My custom dragon eye

I've read this from pburgess who is amazing by the way! I just want to figure this out because I am not the best in understanding something unless there is images on how to do it words don't work the best for me or maybe you can give me another way of solving it. I am a cosplay artist and want to modify these eyes so any help would be appreciated

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: Electronic Animated Eyes for ARM Microcontrollers a guide on how to customize the images

Post by michaelmeissner »

There are lots of different versions of the uncanny eyes or animated eyes or snake eyes as it has been called over time. And if I recall, how to modify the eyes is different for each iteration.

The original uncanny eyes was originally for a Teensy 3.2 (which unfortunately has been not available due to chip shortages for some time). It talked to 128x128 screens, both using TFT displays (ST7735 driver) or OLED displays (SSD1351). You could also use the same source on the Teensy 3.5 and 3.6 systems (also nearly unavailable). This used internals in those chips to speed up the display. This source had a single eye that was pre-compiled into the sketch. Later the author added support for Adafruit ItsyBitsy and Feather M0 & M4 boards, using machine specific DMA optimizations (i.e. it won't likely run on other processors like the ESP32). The display with the update is still the 128x128 display. The Hallowing M0 combines the microprocessor and the 128x128 display.

The next iteration was snake eyes for the Raspberry Pi. I don't know much about this version. The third iteration is the version for the M4 processors using the M4 processor and the 240x240 displays (ST7795 driver). This was used for the Monster M4SK (eyeglasses with 2 displays built-in) and the Hallowing M4 (1 display built-in). This version used the flash memory of these chips to hold BMP image files, and some configuration files. I was able to change the demon red eye to a green eye using gimp and a few mods to the config file. The M4 code uses chip internals for the M4 processors, and it also changes the direction of the image processing, which meant you couldn't do some eyes in the first iteration.

In the Teensy world, there are at least 4 versions of modifications. I can point you to the various places these are discussed or the sources.
  • The first two modifications were to the original uncanny eyes, and it modifies the code so it can be used by the newer Teensy 4.0 and 4.1 processors. The second modification also modified the code to use the 240x240 displays, and modified one eye (hazel) so that it was appropriate for the 240x240 displays. This code uses the Teensy specific libraries which do optimizations, but the eye code itself is fairly generic.
  • I modified this code to move it into a library, so that I could have many different sketches, each one with a specific configuration (1 or 2 eyes, 128x128 or 240x240 displays, etc.) without having to copy the entire code to different sketch directories.
  • The last modification is to rewrite the code using the M4 eyes code as a base. Unlike the previous Arduino iterations, you could have multiple eyes, and modify them over time. Originally the code was targeted towards the newer round 240x240 displays (with the GC9A01A drive). The author then modified the code to also use the 240x240 displays (ST7795 driver), such as what Adafruit sells. The code also has support for the 'people sensor' that Sparkfun uses to track people moving about in the room.
There is also one or more variants floating around specifically for the GC9A01A displays. My sense is it is the original uncanny eyes, using the hazel eyes that were modified for the 240x240 displays. Thus if you select a different eye, you get a smaller 128x128 image inside of the 240x240 display. I don't know much about these.

User avatar
jazzmanny
 
Posts: 2
Joined: Mon Mar 13, 2023 10:51 pm

Re: Electronic Animated Eyes for ARM Microcontrollers a guide on how to customize the images

Post by jazzmanny »

Thanks its for the Hallowing Eyes is what I am using just trying to figure out how to convert the image to work with it correctly

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”