Electronic Animated Eyes using Teensy 3.1

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
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

Post by pburgess »

Wiring looks good and I still haven't been able to reproduce the issue nor see any likely culprit.

To confirm some assumptions:
  • You've run the normal SSD1351 'test' example (with dc/cs/rst pins adjusted to match wiring) and this works?
  • You did NOT install the Adafruit_GFX or Adafruit_SSD1531 libraries offered by the Teensyduino installer? Use the Arduino Library Manager instead or fetch the code from Github. The Teensyduino versions may break something. Remove them if that's what you installed.
  • You're running the plain vanilla Uncanny Eyes sketch linked to in the guide, not anyone's custom variant just yet, correct?
  • Using the default human eye?
  • Teensy speed set at 72 MHz?
If it's not any of that, please elaborate on your system setup: OS, IDE version, etc. (e.g. Windows 10, Arduino IDE 1.8.2, Teensyduino 1.35 installer)

User avatar
_Wosky_
 
Posts: 6
Joined: Sat Jun 03, 2017 1:14 am

Re: Electronic Animated Eyes using Teensy 3.1

Post by _Wosky_ »

Now everything is working fine, I set the teensy to 16MHz, and works perfectly.
tho, now the teensy doesn't appear on ports, and I need to use an FTDI board to upload the code, any ideas why this happened?
anyways, thanks for all the help you gave me.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

Post by pburgess »

When running the Teensy board below 24 MHz, it's normal for there to be no serial port (since it can't handle USB timing at these lower speeds). It's not necessary to pick a port when uploading to this board over USB; the Teensy Loader application and bootloader kind of do their own thing. Port's only needed if using Serial.print().

With the OLED displays, you can run the Teensy board up to 72 MHz (and have USB serial if you need it).

User avatar
_Wosky_
 
Posts: 6
Joined: Sat Jun 03, 2017 1:14 am

Re: Electronic Animated Eyes using Teensy 3.1

Post by _Wosky_ »

oh, okay.
I tried to use 72mhz but sadly, it doesn't work.

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

Re: Electronic Animated Eyes using Teensy 3.1

Post by michaelmeissner »

As I said earlier, I could only get the Adafruit displays to run at 24Mhz (which is the slowest speed where USB serial will still work). I could not get them to work at 48Mhz. And a different brand of the OLED displays (newhaven), I could run at 48Mhz, but not 72Mhz.

So, I suspect sample variation, and you just have to test the display to see what works for you. It may be the 24Mhz was a particular run of the displays, and another batch might be slower or faster.

User avatar
GRNdragon
 
Posts: 5
Joined: Mon Jun 19, 2017 7:47 pm

Re: Electronic Animated Eyes using Teensy 3.1

Post by GRNdragon »

If the displays are freezing or displaying garbage, then edit the SPI clock speed, highly dependent on cable length.

SPISettings settings(19000000, MSBFIRST, SPI_MODE3); // Teensy 3.1 max SPI

Try values from 15000000 to 20000000

I have a Teensy 3.2 running 120MHz overclocked

And not all 5V power supplies are equal, solder a 100uF 6V on Teensy 5V buss

User avatar
_Wosky_
 
Posts: 6
Joined: Sat Jun 03, 2017 1:14 am

Re: Electronic Animated Eyes using Teensy 3.1

Post by _Wosky_ »

So I'm trying to upload the dragon eye example, and it gives this error

dragonEye.h:15637: error: narrowing conversion of '-1' from 'int' to 'uint16_t {aka short unsigned int}' inside { } [-Wnarrowing]
0X007F, 0X007F, 0X007F, 0X007F, 0X007F, 0X007F, 0X007F, 0X007F, };

^

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

Post by pburgess »

***EDIT*** ***UPDATE*** This is no longer necessary, though there is ZERO harm in doing it this way if that's what you've got installed. The code will compile now in the latest Arduino IDE & Teensyduino just fine. Make sure to fetch the current Adafruit eye code from Github as a starting point. If you're using any other fork or variant, it might not have the necessary fix yet.
If you plan to use the dragon eyes (or any of the non-default, non-human eyes), you should install the Arduino IDE version 1.8.1 and then run the Teensyduino 1.35 installer atop this. This is a temporary situation due to a bug in the latest Teensy compiler preventing arrays over 32K…guide will be updated when this is fixed. If you want the latest IDE for other projects, it’s valid and possible to have multiple Arduino IDE installs on your system, just need to give each a unique name.
IDE 1.8.1 can be downloaded here: https://www.arduino.cc/en/Main/OldSoftw ... s#previous
And Teensyduino 1.35 here: https://forum.pjrc.com/threads/41493-Te ... -35-Beta-2
Last edited by pburgess on Sun Jul 16, 2017 11:33 pm, edited 3 times in total.

User avatar
_Wosky_
 
Posts: 6
Joined: Sat Jun 03, 2017 1:14 am

Re: Electronic Animated Eyes using Teensy 3.1

Post by _Wosky_ »

I'm such a dummy sometimes (ok fine, most of the times). Thank you guys so much for being so nice nwn.

last question (I hope so), I'm trying to do a Dragon/demon-like eyes, and I successfully changed the iris color, but I fail at the pupil.

So, I noticed that the dragon and g0at (banned word, why tho?) eyes have a pupil map, where it is supposed to go? I tried both of this options but none of them worked for me.

a) python tablegen.py DragonEye/sclera.png DragonEye/iris.png DragonEye/upper.png DragonEye/lower.png DragonEye/PupilMap 160 > DragonEye.h

b) python tablegen.py DragonEye/sclera.png DragonEye/iris.png DragonEye/upper.png DragonEye/lower.png 160 DragonEye/PupilMap > DragonEye.h

c) Add your reply here.

Again, thanks a lot.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

Post by pburgess »

Howdy.

Someone spotted a bug recently in the eye code, now fixed, and it turns out it can be compiled in the latest Arduino IDE & Teensyduino if that's what you've got. No harm though in using the 1.8.1/1.35 combo. All good, whichever version, just be sure to download the latest eye code (including the converter script) from Github.

Converting the dragon eye is SUPER kludgey and horrible, I apologize in advance for this...

First, copy the dragon pupil map image to the same directory containing the 'tablegen' script, and call it 'pupilMap.png'. i.e. like this:

Code: Select all

cp dragonEye/dragonPupilMap.png pupilMap.png
Then, when doing the conversion, use a *negative* iris size to tell the script it should use the pupilMap image (the filename is hardcoded and not specified on the command line):

Code: Select all

python tablegen.py dragonEye/sclera.png dragonEye/iris.png dragonEye/upper.png dragonEye/lower.png -160 > myNewEye.h

User avatar
novice516
 
Posts: 7
Joined: Wed Feb 01, 2012 11:58 pm

Re: Electronic Animated Eyes using Teensy 3.1

Post by novice516 »

I am working on the Animated Eyes using the teensy 3.2. When I try to upload the code which was posted on the animated eyes learning page https://learn.adafruit.com/animated-ele ... 1/software the software compiles, but when I try to upload it, teensy informs me that the code is too large. I did not modify the code other than as instructed to work with the TTF - thus commenting out the OLE and un-commenting the TTF in lines 28-29. I am using the arduino 1.81 IDE and did not load the libraries listed like GFX as instructed when i installed the teensyduino 1.35 beta #2.

Thank you in advance.



Novice,
Tom

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

Post by pburgess »

Which of the eye designs are you using, and what's the "Optimize" setting in the Tools menu?

User avatar
Snufkin52
 
Posts: 2
Joined: Tue Jul 11, 2017 7:42 pm

Re: Electronic Animated Eyes using Teensy 3.1

Post by Snufkin52 »

Hello, I need your help.
I try to create Eyes, using Teensy 3.1, but i couldn't buy 1.44'' TFT display, i bought TFT Display 126x160.
So, when i start project on board, i sow this picture :

Image

Part of display working current, but it is endless & cycled image.
And eye is stretched.
May be you can help me solve this problem?

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

Post by pburgess »

The code doesn't work with 160x128 displays, but a couple of threads have explored the possibility of using a 128x128 pixel section of the screen. No guarantees, there are many ever-so-slightly different versions of these screens, but these might offer some hints on adapting the code:

viewtopic.php?f=22&t=81236&p=542009&hil ... 60#p541329
viewtopic.php?f=22&t=81236&start=20

User avatar
novice516
 
Posts: 7
Joined: Wed Feb 01, 2012 11:58 pm

Re: Electronic Animated Eyes using Teensy 3.1

Post by novice516 »

I am using the "smallest code with LTO" and the default eye setting

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

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