Uncanny Eyes - Switch eye using button

Experimentalist

Well-known member
With the Uncanny Eyes project, has anyone tried to have multiple eyes loaded into memory and switch between them using a button at run time? With the later chips there is plenty of memory and this would be a nice feature.
 
With the Uncanny Eyes project, has anyone tried to have multiple eyes loaded into memory and switch between them using a button at run time? With the later chips there is plenty of memory and this would be a nice feature.

Yes, look at my thread on it. Chris.nz converted the Adafruit code for the M4 processors (Monster M4SK and Hallowing M4) to Teensy 4.x for PlatformIO. They/he/she/it added multiple eye support and support for the person sensor that Sparkfun sells. Support is there for using 2 240x240 displays (either the round displays with the GC9A01A driver or the square display with the ST7789 driver).

I tweaked it for running under Arduino, etc. and added some of my own changes.

Chris said he/she/they/it had a new job in December, and she/he/they/it hasn't posted since. I haven't done much Teensy hacking in a while, but I should get back to it. At the moment, the code doesn't use a button press, but it should be simple to add (look at the call to nextEye in loop):


Note, I was only able to fit 8 eyes with the Teensy 4.0 and all 19 eyes with the Teensy 4.1. With the Teensy 4.0 you have to solder a couple of wires underneath the Teensy in order to use the second SPI controller. So, if possible, you want to use the Teensy 4.1 as your base.
 
Last edited:
@MichaelMeissner do you have any links to Uncanny Eyes 128x128 data files by any chance?

I have the following already but guess there are many more somewhere:

catEye.h
defaultEye.h
doeEye.h
dragonEye.h
goatEye.h
logo.h
naugaEye.h
newtEye.h
noScleraEye.h
owlEye.h
terminatorEye.h
 
Last edited:
@MichaelMeissner do you have any links to Uncanny Eyes 128x128 data files by any chance?

I have the following already but guess there are many more somewhere:

catEye.h
defaultEye.h
doeEye.h
dragonEye.h
goatEye.h
logo.h
naugaEye.h
newtEye.h
noScleraEye.h
owlEye.h
terminatorEye.h

Those are the only patterns I have. They came with the original Uncanny Eyes source at Adafruit.

The Uncanny Eyes page at the Adafruit Learning guides has a page about doing custom eyes:

With the re-vamped eye code for the 240x240 displays that chris.nz did, there are the following eyes:
  • cat.h
  • demon.h
  • dragon.h
  • hazel.h
  • hypnoRed.h
  • skull.h
  • snake.h
  • toonstripe.h
  • anime.h
  • bigBlue.h
  • brown.h
  • doe.h
  • doomRed.h
  • doomSpiral.h
  • fish.h
  • fizzgig.h
  • leopard.h
  • newt.h
  • spikes.h

I made a dragon staff using a Hallowing M4, and I used gimp to change color of the demon eye from red to green since the staff was green in color. I haven't converted the bmp file back to a .h file and add it back to the 240x240 displays, but maybe I should.
 
Thanks once again for taking the time to reply, I just don't want to waste time reinventing the wheel when the work is already done and out there!

Perhaps somebody else has come up with other eyes. I didn't see any other things referring to Uncanny Eyes over at the Adafruit Learning pages, but maybe do a query over at the Adafurit forum. There are 4 main strains of the code:

  • Uncanny Eyes (https://learn.adafruit.com/animated-electronic-eyes), written originally for the Teensy 3.1/3.2, and adapted for some of the other processors like the Hallowing M0. This uses the 128x128 displays, and it uses hardware tricks on both the Teensy and M0 processors to speed it up. You can only have one eye pattern (1 or 2 eyes displayed), and it is compiled into C code. The source at Adafruit will not work on Teensy 4.0/4.1. There are adaptions to run on Teensy 4.x. in the ST7735 examples directory.
  • Animated Snake Eyes for Raspberry Pi (https://learn.adafruit.com/animated-snake-eyes-bonnet-for-raspberry-pi/). This was written after Uncanny Eyes but before Monster M4SK. Because the Pi has more resources, it evidently renders the eye in real time, and you can either do 2 smaller 128x128 or 240x240 screens similar to Uncanny Eyes or one larger HDMI screen with a single eye. The eyes are stored in the PI file system and can be jpg, png, etc. Because the Pi is optimized for HDMI, the output goes to the HDMI display. If you are using the 128x128 or 240x240 displays, there is a program that uses the frame buffer created for the HDMI display, and then copies regions to the 2 SPI displays.
  • When the Hallowing M4 and Monster M4SK came out, the code was completely rewritten (https://learn.adafruit.com/adafruit-monster-m4sk-eyes). It uses the flash file system Adafruit adds for their Circuit Python boards. The config file is a text file, and the graphics are BMP files. You can only have one eye pattern (1 or 2 eyes displayed) running in the programs, because of memory limitations. The Monster M4SK code will allow you to use 4 different eyes based on buttons pushed when the M4SK is powered up (but once powered on, you can't switch eyes). I believe the rendering was changed and it meant some eyes like dragonEye could not be used in this code.
  • Chris.nz rewrote that code, keeping the basic method, but going back to compiling the eye graphics into C code. They/he/she ripped out the low level rendering, and instead used the frame buffer rendering in the Teensy specific libraries. I made some mods to it to port it from PlatformIO to Arduinio and other stuff. You need (in theory) a Teensy 4.0 or 4.1. With Chris.nz's code, you can have multiple eyes and switch between them at runtime. The Teensy 4.0 can hold maybe 8 different eyes. The Teensy 4.1 can hold all 19 eyes. I mentioned the source for this above. You can use either the square 240x240 displays or the round 240x240 displays.

So in answer to your question, at present only Chris.nz's code with some minor mods (and maybe the Raspberry Pi snake eyes code) can do multiple eyes.

The Monster M4SK code can do different eyes if you add some extra code so that it changes the eye at boot time. To change eyes, you would need to have the microprocessor restart. I recall seeing somebody had done that. I don't remember if I saw the source and saved it. Note, the Monster M4SK code will not run on a Teensy without modification.
 
Last edited:
BTW, I suspect there may be a new version of the eyes code shortly. Adafruit has released the following new products (plus some more displays pre-announced):


At the moment, there is no learning example in the Qualla processor page, but usually Adafruit puts the page out a week or so after the product is shipping.

These displays are connected via a 40 pin cable. Unlike the earlier displays, you can't drive the display via SPI (you do setup via SPI, but the actual display is done by 18 pins in parallel for the 6 bits for each color, plus 4 additional pis for control).

I would imagine that we will see a new variant of the eye code. Or possibly the raspberry pi and/or Monster M4SK code will be tweaked to handle this display.

I saw that they had a few copies of the micro processor and displays on hand, so I ordered 1 microprocessor and 1 2.1" 480x480 cap. touch display.

Given the amount of pins, I would imagine it might be possible for the Teensy 4.1 to drive these displays. In theory, you could the FlexIO 1 and FlexIO 2 pins to drive the 18 pins for the parallel display, but I will leave that up to others to investigate.
 
BTW, I suspect there may be a new version of the eyes code shortly. Adafruit has released the following new products (plus some more displays pre-announced):


At the moment, there is no learning example in the Qualla processor page, but usually Adafruit puts the page out a week or so after the product is shipping.

These displays are connected via a 40 pin cable. Unlike the earlier displays, you can't drive the display via SPI (you do setup via SPI, but the actual display is done by 18 pins in parallel for the 6 bits for each color, plus 4 additional pis for control).

I would imagine that we will see a new variant of the eye code. Or possibly the raspberry pi and/or Monster M4SK code will be tweaked to handle this display.

I saw that they had a few copies of the micro processor and displays on hand, so I ordered 1 microprocessor and 1 2.1" 480x480 cap. touch display.

Given the amount of pins, I would imagine it might be possible for the Teensy 4.1 to drive these displays. In theory, you could the FlexIO 1 and FlexIO 2 pins to drive the 18 pins for the parallel display, but I will leave that up to others to investigate.
I have those boards with 2.1" round display. They are not fast as they claimed. I've been working on them for 3 months and no good FPS above 20-30. DMA needs double buffer. And the code for Arduino has like 23523 files. I cleaned almost all of them but still flickering. I've tried phyton too. Slower than Arduino samples. So I was looking for to implement some of the code to Teensy 4.1 . And still working on. if you have any progress please feel free to tell us.
 
I have those boards with 2.1" round display. They are not fast as they claimed. I've been working on them for 3 months and no good FPS above 20-30. DMA needs double buffer. And the code for Arduino has like 23523 files. I cleaned almost all of them but still flickering. I've tried phyton too. Slower than Arduino samples. So I was looking for to implement some of the code to Teensy 4.1 . And still working on. if you have any progress please feel free to tell us.
I haven't really done any microprocessor coding in quite some time. I did buy a Qualia and 2 displays, but I haven't done anything other than run the initial rainbow demo.
 
Still images are good. Timing of the LCD is good. But when you want to move things around and show some real time values in the screen. it stars flickering. Because ESP32 uses LCD with DMA. There is one Framebuffer in the code. So you are using it while it is flushing to the LCD. so Screen shows tearing all the time. That's why I'm trying to do my project on Teensy 4.1 I hope I would done it in short time
 
Back
Top