uncanny eyes with Teensy 3.1

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
rbbtebo
 
Posts: 57
Joined: Tue Aug 18, 2015 9:12 am

Re: uncanny eyes with Teensy 3.1

Post by rbbtebo »

I second what VKSOI said!

User avatar
KANAMAN
 
Posts: 6
Joined: Thu Oct 22, 2015 8:30 pm

Re: uncanny eyes with Teensy 3.1

Post by KANAMAN »

This 44mm lens works great. Makes the eye huge.
[urlhttp://www.amazon.com/gp/product/B00HLBHLIA?ps ... ge_o06_s00][/url]
image1 (3).JPG
image1 (3).JPG (263.01 KiB) Viewed 2005 times

User avatar
zombie2120
 
Posts: 2
Joined: Sat Nov 07, 2015 4:58 pm

Re: uncanny eyes with Teensy 3.1

Post by zombie2120 »

I am extremely new at this and thought I would give this a try. I am getting the following errors when I try to compile. I already did the test for display and its working fine. Just can not get file to compile. Any help would be greatly appreciated.
In file included from uncannyEyes.ino:27:0:
C:\Users\ZOMBIE AMUSEMENTS\Documents\Arduino\libraries\Adafruit_SSD1351_library/Adafruit_SSD1351.h:22:0: warning: "swap" redefined [enabled by default]
#define swap(a, b) { uint16_t t = a; a = b; b = t; }
^
In file included from uncannyEyes.ino:17:0:
C:\Program Files\Arduino\hardware\teensy\avr\libraries\Adafruit_GFX/Adafruit_GFX.h:11:0: note: this is the location of the previous definition
#define swap(a, b) { int16_t t = a; a = b; b = t; }
^
uncannyEyes.ino:479:17: warning: extra tokens at end of #ifdef directive [enabled by default]
uncannyEyes.ino: In function 'void frame(uint16_t)':
uncannyEyes.ino:346:67: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
uncannyEyes.ino:423:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
In file included from C:\Users\ZOMBIE AMUSEMENTS\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.cpp:21:0:
C:\Users\ZOMBIE AMUSEMENTS\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.h:22:0: warning: "swap" redefined [enabled by default]
#define swap(a, b) { uint16_t t = a; a = b; b = t; }
^
In file included from C:\Users\ZOMBIE AMUSEMENTS\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.cpp:20:0:
C:\Program Files\Arduino\hardware\teensy\avr\libraries\Adafruit_GFX/Adafruit_GFX.h:11:0: note: this is the location of the previous definition
#define swap(a, b) { int16_t t = a; a = b; b = t; }
^
Teensy Loader could not find the file uncannyEyes.cpp
Error compiling.

User avatar
zombie2120
 
Posts: 2
Joined: Sat Nov 07, 2015 4:58 pm

Re: uncanny eyes with Teensy 3.1

Post by zombie2120 »

I seem to have to found the problem and now its works just fine

User avatar
charxian
 
Posts: 10
Joined: Thu Dec 08, 2011 6:35 pm

Re: uncanny eyes with Teensy 3.1

Post by charxian »

Im having the same problem, how did you fix it?

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

Re: uncanny eyes with Teensy 3.1

Post by pburgess »

What version of the Arduino IDE are you using? I had some trouble with 1.6.6 and Teensy, it's a bit bleeding edge and may require a little integration time. 1.6.5 was OK though.

Also, install the GFX and display libraries using the Arduino Library Manager, not from the Teensyduino installer.

User avatar
PunyViking
 
Posts: 2
Joined: Tue Dec 15, 2015 1:32 pm

Re: uncanny eyes with Teensy 3.1

Post by PunyViking »

Nice project!

I have made this with one of those cheap ebay tfr lcd's, 1.8" 128x160 pixels. And with a few modifications to the code it works like a charm!

But I would like to rotate the eye on the display to make the most out of the height of the display and to make the displays fith the project better, but the obvious way to do this

Code: Select all

eye[e].display.setRotation(1);
after the the InitR doesn't work. A great deal of nothing is changed. Is there a way to rotate the image using code? If not I have to rotate by changing the graphics, and that will need both displays to be rotated the same way, and I want each displays to rotate the oposite ways.

Thanks!

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

Re: uncanny eyes with Teensy 3.1

Post by pburgess »

Not familiar with the display in question, but it's possible they implement rotation differently; setRotation() may require some work and a datasheet.

If you do need to 'manually' rotate the graphics, you might not need separate right/left. The eye code exploits the mirroring capability of the Adafruit TFT & OLED displays...if the same capability exists in the displays you're using, it's just a matter of issuing the right commands.

User avatar
PunyViking
 
Posts: 2
Joined: Tue Dec 15, 2015 1:32 pm

Re: uncanny eyes with Teensy 3.1

Post by PunyViking »

I just made it! I needed to move the

Code: Select all

eye[e].display.setRotation(1);
from void setup to void draw eye!.

I just love this project! Now my quadruped robot are going to get some eyes!!!

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

Re: uncanny eyes with Teensy 3.1

Post by pburgess »

PunyViking wrote:Now my quadruped robot are going to get some eyes!!!
That sounds TERRIFYING. :) Please post pics!

Glad to hear it was a simple fix.

User avatar
merlins_ghost
 
Posts: 50
Joined: Wed Jan 07, 2015 1:39 am

Re: uncanny eyes with Teensy 3.1

Post by merlins_ghost »

I have been having a lot of fun making eye's (from human to robotic eyes) with the uncanny eyes project. I do have a question though I was looking at the python code and noticed that there was code there for the pupil map if the radius was put in as a negative number, but it does not seem to be working with the files that I am using, what are the parameters for using the pupil map? Does the pupil map code work? I used the pupil map from the dragon eye for testing, but got errors. I did rename the dragon pupil map to PupilMap.png.
Thanks
Last edited by merlins_ghost on Sun Dec 27, 2015 4:08 am, edited 3 times in total.

User avatar
merlins_ghost
 
Posts: 50
Joined: Wed Jan 07, 2015 1:39 am

Re: uncanny eyes with Teensy 3.1

Post by merlins_ghost »

Regarding the making of eyes, have you thought about making a collection point where people could post their eye image creations or parts (.h or .png files)? I have created a plethora of eyes that others might like to use that I would be willing to share, some are quite cool. I am also very curious what kind of eye images others are making. Example(s)
Eye-Aperature.JPG
Eye-Aperature.JPG (42.06 KiB) Viewed 1484 times
Eye-Biohazard.JPG
Eye-Biohazard.JPG (36.79 KiB) Viewed 1484 times
Eye-Umbrella.JPG
Eye-Umbrella.JPG (35.07 KiB) Viewed 1484 times

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

Re: uncanny eyes with Teensy 3.1

Post by pburgess »

Those are amazing! Would love to see them in motion. Does the aperture eye do the...uh...aperture thing?

The pupil map image needs to be named 'pupilMap.png' (initial p is lower case) and must match the iris dimensions exactly. What sort of errors are you seeing exactly?

User avatar
merlins_ghost
 
Posts: 50
Joined: Wed Jan 07, 2015 1:39 am

Re: uncanny eyes with Teensy 3.1

Post by merlins_ghost »

Yes, the aperture does the aperture thing. I will recompile later today using the lower case p and see what happens. Here are three more. The first is a nebula that I converted.
Attachments
Eye-Nebula.JPG
Eye-Nebula.JPG (35.39 KiB) Viewed 1452 times
Eye-Santa.JPG
Eye-Santa.JPG (47.25 KiB) Viewed 1452 times
Eye-Radiation.JPG
Eye-Radiation.JPG (37.32 KiB) Viewed 1452 times

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

Re: uncanny eyes with Teensy 3.1

Post by pburgess »

Crazy stuff. Santa eye is SCARY! :)

BTW, if you want to go even more crazy, it's pretty easy to rotate the irises...might look especially cool with things like the nebula. In uncannyEyes.ino, around like 184:

Code: Select all

          a = (IRIS_MAP_WIDTH * (p >> 7)) / 512;        // Angle (X)
Right after this, you can add in an offset and clip it to the iris coordinates, something like:

Code: Select all

          a = (a + someOffset) % IRIS_MAP_WIDTH;
where 'someOffset' is a global int that you increment every frame. (Since the code uses the mirroring feature of the displays, they'll spin in opposite directions).

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

Return to “Other Arduino products from Adafruit”