0

Electronic Animated Eyes using Teensy 3.1
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Electronic Animated Eyes using Teensy 3.1

by jwheat058 on Sat Oct 03, 2015 11:56 am

Hello - I commented out the line as you suggested and it did stop the blink, but what I would like is to get rid of the black eyelid mask over the eyeball completely, so it is just the round eyeball. Is that possible? And glad to hear that the code for this is forward-compatible.... Thanks for your great help!

jwheat058
 
Posts: 11
Joined: Sat Sep 26, 2015 11:43 am

Re: Electronic Animated Eyes using Teensy 3.1

by pburgess on Sat Oct 03, 2015 12:02 pm

Oh, sure. In the drawEye() function, look for this:
Code: Select all | TOGGLE FULL SIZE
      if((lower[screenY][screenX] <= lT) ||
         (upper[screenY][screenX] <= uT)) {             // Covered by eyelid

and just replace it with:
Code: Select all | TOGGLE FULL SIZE
      if(0) {

pburgess
 
Posts: 3993
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

by jwheat058 on Sat Oct 03, 2015 12:24 pm

That worked PERFECTLY! Exactly what I was looking for! Note for the others, if you turn on line numbering, this code is at line 174.

OK, next question... Is it possible to change the size of the eyeball? It would be nice to have a display that was the size of an actual human eye. I know, I know... Gimme! Gimme! Gimme! Ha! I am ecstatic about the quality of this display! Really cool! Thanks again for your great help!

jwheat058
 
Posts: 11
Joined: Sat Sep 26, 2015 11:43 am

Re: Electronic Animated Eyes using Teensy 3.1

by pburgess on Sat Oct 03, 2015 11:21 pm

It's possible, but isn't a simple code tweak...at the very least, you need to provide a new sclera image (or resize the example to the desired size) and run it through a conversion script, as documented on the 'Customizing' page:

https://learn.adafruit.com/animated-ele ... ustomizing

pburgess
 
Posts: 3993
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

by jwheat058 on Sun Oct 04, 2015 9:32 am

Thank you for the info on re-sizing - It's good to know that it is possible, if I need to do it. Just hoping it was another easy fix like the last ones (i.e., EyeSize = 300, 300) - Ha! Anyway, I am extremely happy with what I have. Thanks again for all you help!

jwheat058
 
Posts: 11
Joined: Sat Sep 26, 2015 11:43 am

Re: Electronic Animated Eyes using Teensy 3.1

by jwheat058 on Sun Oct 11, 2015 2:59 pm

Finished my project and it came out great! Could not have pulled this off without these OLED eyes! Here is a link to a Photobucket album that shows the project:

http://s1006.photobucket.com/user/jwhea ... yes%20Mask
Video does not do the mask justice - looks way better in real life!

Note that the video may not work when using Google Chrome - Try IE instead.

Thanks for all the help! Jeff

jwheat058
 
Posts: 11
Joined: Sat Sep 26, 2015 11:43 am

Re: Electronic Animated Eyes using Teensy 3.1

by Thieri on Mon Oct 12, 2015 11:44 am

Is there an example for the g0at Eye?
The math for slit / dragonsEye doesnt fit there and the Map-file isnt being used (always getting round pupil)
Could you/someone please explain a little further?

I tried to get G0atEye with custom colors and maybe pivot too...
Thanks in advance

https://www.dropbox.com/s/622vv9nga0arc ... 8.jpg?dl=0

The word g0at is a banned word, so please dont mind my strange writing...

Thieri
 
Posts: 3
Joined: Fri Sep 25, 2015 8:26 am

Re: Electronic Animated Eyes using Teensy 3.1

by pburgess on Tue Oct 13, 2015 2:35 am

The tablegen.py script currently can only handle a round pupil. "Novelty shapes" like the dragon or g0at™ are a kludge...basically, if you pass a negative iris size, the script loads an image (always called 'pupilMap.png') to use for pupil size calculations (image dimensions must match the absolute value of this size, e.g. pass -128 for a 128x128 pixel image).

Pixel brightness in this image corresponds to the pupil size/shape in response to light. For example, here's a 160x160 g0at pupil:
goatPupil.png
goatPupil.png (3.66 KiB) Viewed 614 times

I haven't figured out the math for doing these funky pupil shapes all algorithmically, so the image thing was an interim compromise. Wanted to show that the eyeball code is fairly open-ended and customizable, even if I don't have the answers for every customization.

pburgess
 
Posts: 3993
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

by Thieri on Tue Oct 13, 2015 3:24 pm

Thanks a lot

Thieri
 
Posts: 3
Joined: Fri Sep 25, 2015 8:26 am

Re: Electronic Animated Eyes using Teensy 3.1

by Yardracer on Wed Oct 14, 2015 8:20 pm

So I've gotten the blink sketch to work, but when I try to test compile the sketch, I get an error for "extra tokens at end of #ifdef directive, and "INITR_144GREENTAB was not declared in this scope." What does this mean, and what am I missing?

Yardracer
 
Posts: 5
Joined: Wed Oct 14, 2015 7:27 pm

Re: Electronic Animated Eyes using Teensy 3.1

by pburgess on Wed Oct 14, 2015 8:43 pm

What line number is throwing the error? Most likely the display library isn't installed, or the wrong one is enabled. Which screen type are you using?

pburgess
 
Posts: 3993
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

by Yardracer on Wed Oct 14, 2015 8:50 pm

I am using the 1.44" TFT. I commented out the line about the OLED, and uncommented the like for the TFT in the setup part. I also included the library Adafruit_ST7735 at the top of the sketch. Line 111 is the one that is showing up in the debug.

Yardracer
 
Posts: 5
Joined: Wed Oct 14, 2015 7:27 pm

Re: Electronic Animated Eyes using Teensy 3.1

by pburgess on Wed Oct 14, 2015 8:56 pm

What version of the Arduino IDE are you using? Could you copy-and-paste the complete error list? Or maybe a screen shot? Thanks.

pburgess
 
Posts: 3993
Joined: Sun Oct 26, 2008 2:29 am

Re: Electronic Animated Eyes using Teensy 3.1

by Yardracer on Wed Oct 14, 2015 8:57 pm

The line that highlights during debug is

eye[e].display.initR(INITR_144GREENTAB);

Yardracer
 
Posts: 5
Joined: Wed Oct 14, 2015 7:27 pm

Re: Electronic Animated Eyes using Teensy 3.1

by Yardracer on Wed Oct 14, 2015 9:00 pm

IDE is 1.6.5

I'm not sure how to attach a screenshot, but here is the error copy:
attArduino: 1.6.5 (Windows 8.1), TD: 1.25, Board: "Teensy 3.2 / 3.1, Serial, 72 MHz optimized, US English"

uncannyEyes.ino:466:17: warning: extra tokens at end of #ifdef directive [enabled by default]
uncannyEyes.ino: In function 'void setup()':
uncannyEyes:111: error: 'INITR_144GREENTAB' was not declared in this scope
uncannyEyes.ino: In function 'void frame(uint16_t)':
uncannyEyes.ino:333:67: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
uncannyEyes.ino:410:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Multiple libraries were found for "Adafruit_ST7735.h"

Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Adafruit_ST7735

Not used: C:\Users\Ian\Documents\Arduino\libraries\Adafruit_ST7735_Library

'INITR_144GREENTAB' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

Yardracer
 
Posts: 5
Joined: Wed Oct 14, 2015 7:27 pm

Please be positive and constructive with your questions and comments.