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 Dragten on Wed Mar 09, 2016 5:31 am

Thank you once again, Philip, the sensitivity code worked like a charm!

Dragten
 
Posts: 10
Joined: Tue Feb 23, 2016 7:51 am

Re: Electronic Animated Eyes using Teensy 3.1

by moose_bot on Fri Mar 18, 2016 3:47 pm

pburgess wrote:pqmaker: only works with the 1.44/1.5" displays. The larger screens have about 5x the pixels, which would exceed the processing and internal storage capabilities of the microcontroller.

First I would like to say Thank You for all your work on this project, it's just what I've been looking for.

After reading all the posts here (several times) I finally got my 1.44" TFT's to work! SPOOKY!! I love it.
I did notice that the colors are different from left eye to right eye.
If I am correct this is because of the 'start pixel' color and the way the displays are flipped for left and right.
I found this to be really noticeable when I tried the dragon eyes. The right eye is perfect (green with some red at the edges), so cool looking
The left eye is more white with blue edges.
My question is???? Is there a way to fix this?

I'm looking to build 5 sets of these for my Halloween display and it would be cool to have different pairs of 'eyes' on each of them

Also my display has "snow" on the lower portion of the field (I suspect because of the 160 pixels Vertical and the 128 pixels on the OLED display)
Is it possible to clear the display to black somewhere in the startup?
Maybe with something like....
tft.setCursor(0, 0);
tft.fillScreen(ST7735_BLACK);
This is from graphicstest.ino

moose_bot
 
Posts: 6
Joined: Wed Mar 16, 2016 9:15 am

Re: Electronic Animated Eyes using Teensy 3.1

by pburgess on Fri Mar 18, 2016 4:19 pm

Not sure what's up with the color shift. Note that it may simply be the viewing angle; TFTs are notoriously direction-sensitive. Or they might be from different production batches and have different LCDs...did they have different-colored 'tabs' on the clear plastic protector sheet? Could you post a photo so I can see what you're seeing?

As for 'snow' on the larger display: yes, if you pick apart the code and find where it's setting the "address window," you could copy these commands to the display init section, setting the window for 160x128, and then push a suitable number of zero bytes (160*128*2) to clear the display. Then tweak the address window elsewhere in the code to use the 128x128 center part of the screen.

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

Re: Electronic Animated Eyes using Teensy 3.1

by moose_bot on Mon Mar 21, 2016 3:23 pm

Got the 'snow' problem fixed, Thanks for the pointer on that one.
Still have the color shift issue.
I tried swapping the displays (left to right) and the right one is always correct on color
so I don't think its the displays themselves.
As you can see, the 'tabs' are the same color (yes these are the eBay cheapie displays)
My OLED's are supposed to be in today.
I wanted to try the TFT's because I have 5 skulls that I want to install these in and the OLED's
are a little pricey at $100 for two OLED's and a Teensy.

I will submit a picture soon.

moose_bot
 
Posts: 6
Joined: Wed Mar 16, 2016 9:15 am

Re: Electronic Animated Eyes using Teensy 3.1

by moose_bot on Mon Mar 21, 2016 3:38 pm

eyes.jpg
eyes.jpg (337.18 KiB) Viewed 764 times
here's the pic

moose_bot
 
Posts: 6
Joined: Wed Mar 16, 2016 9:15 am

Re: Electronic Animated Eyes using Teensy 3.1

by pburgess on Mon Mar 21, 2016 3:57 pm

I think it's gonna be this line right here:
Code: Select all | TOGGLE FULL SIZE
  SPI.transfer(0x88); // MADCTL_MY | MADCTL_BGR

You'll need to dig up a datasheet for the particular TFT/driver you're using and see what bits need setting for different color arrangements.
Just venturing a guess though, try 0x80 there and see if that fixes it.

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

Re: Electronic Animated Eyes using Teensy 3.1

by moose_bot on Tue Mar 22, 2016 11:26 am

Well, it did make them the same, but now they're both blue.
Got the datasheet for the display and driver.
I think it might be something in the "init" for the 'non flipped' display
Even though they have "red Tabs" I had to use the "BlackTab' initR to get them to work.
Is this a clue to the problem?

I would like to try these TFT's because they are a little smaller and fit in the skull props that I'm using better.

http://www.ebay.com/itm/1-44-Red-Serial ... SwoydWoYhX

I got them to work but again, the colors are off.
Also I had to tweak the starting address a little to get the image to fit
eye[e].display.setAddrWindow(0, 30, 127, 157);
Don't really know what each of the parameters are, but it seems to work.

moose_bot
 
Posts: 6
Joined: Wed Mar 16, 2016 9:15 am

Re: Electronic Animated Eyes using Teensy 3.1

by moose_bot on Tue Mar 22, 2016 1:30 pm

YAY!
Got it to work with the cheapies
Had to do some playing with the MADCTL bits for each eye, but it looks amazing.
Also helps when you get the left and right in the right order. DUH
And I had them upside down
Set the left to 0x08 and the right to 0x48, and presto!

Thanks for all the help.
Going to play with my OLED's tonight.

moose_bot
 
Posts: 6
Joined: Wed Mar 16, 2016 9:15 am

Re: Electronic Animated Eyes using Teensy 3.1

by pburgess on Tue Mar 22, 2016 1:43 pm

Cool, glad you got it resolved.

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

Re: Electronic Animated Eyes using Teensy 3.1

by kbailey2616 on Sat Mar 26, 2016 8:28 pm

I have the teensy eyes working just fine on one Oled screen only. The black part covers too much of the iris. How can I get rid of the black part and make it all white yet still keep the blink? Thanks!

kbailey2616
 
Posts: 1
Joined: Sat Mar 26, 2016 8:24 pm

Re: Electronic Animated Eyes using Teensy 3.1

by pburgess on Tue Mar 29, 2016 2:27 pm

Comment out this line, around line #47 in the Arduino sketch:
Code: Select all | TOGGLE FULL SIZE
#define TRACKING          // If enabled, eyelid tracks pupil

This will disable pupil tracking, so the eye is always in a maximum open position (except when blinking).

If that still covers too much, you'll need to produce your own upper and lower eyelid images, as explained in the 'Customizing' page of the guide.

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

Re: Electronic Animated Eyes using Teensy 3.1

by Dragten on Tue Jun 28, 2016 5:14 pm

Dear mister Burgess, is it possible to get the original files for the OLED housing?
I need to use a dome of a bigger size and STL files are not possible to edit in Solidworks.

Dragten
 
Posts: 10
Joined: Tue Feb 23, 2016 7:51 am

Re: Electronic Animated Eyes using Teensy 3.1

by pburgess on Tue Jun 28, 2016 5:43 pm

Sure thing. Here's the original models in Autodesk 123D format. I seem to recall a lot of manual subtracting-of-shapes and filleting was required so YMMV.
Eye Enclosures.123dx.zip
(303.02 KiB) Downloaded 51 times

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

Re: Electronic Animated Eyes using Teensy 3.1

by Dragten on Tue Jun 28, 2016 6:46 pm

pburgess wrote:Sure thing. Here's the original models in Autodesk 123D format. I seem to recall a lot of manual subtracting-of-shapes and filleting was required so YMMV.
Eye Enclosures.123dx.zip


Thank you very much, you are always so incredibly helpful!

Dragten
 
Posts: 10
Joined: Tue Feb 23, 2016 7:51 am

Re: Electronic Animated Eyes using Teensy 3.1

by Dragten on Fri Jul 15, 2016 11:23 am

Mister Burges, a hypothetical question:

Is it technically possibly to use a potentiometer to control the squint of the eyes?

Dragten
 
Posts: 10
Joined: Tue Feb 23, 2016 7:51 am

Please be positive and constructive with your questions and comments.