Electronic Animated Eyes using Teensy 3.1
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Dragten
- Posts: 10
- Joined: Tue Feb 23, 2016 7:51 am
Re: Electronic Animated Eyes using Teensy 3.1
Thank you once again, Philip, the sensitivity code worked like a charm!
- moose_bot
- Posts: 6
- Joined: Wed Mar 16, 2016 9:15 am
Re: Electronic Animated Eyes using Teensy 3.1
First I would like to say Thank You for all your work on this project, it's just what I've been looking for.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.
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
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Electronic Animated Eyes using Teensy 3.1
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.
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.
- moose_bot
- Posts: 6
- Joined: Wed Mar 16, 2016 9:15 am
Re: Electronic Animated Eyes using Teensy 3.1
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.
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
here's the pic
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Electronic Animated Eyes using Teensy 3.1
I think it's gonna be this line right here:
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.
Code: Select all
SPI.transfer(0x88); // MADCTL_MY | MADCTL_BGR
Just venturing a guess though, try 0x80 there and see if that fixes it.
- moose_bot
- Posts: 6
- Joined: Wed Mar 16, 2016 9:15 am
Re: Electronic Animated Eyes using Teensy 3.1
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.
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
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.
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.
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Electronic Animated Eyes using Teensy 3.1
Cool, glad you got it resolved.
- kbailey2616
- Posts: 1
- Joined: Sat Mar 26, 2016 8:24 pm
Re: Electronic Animated Eyes using Teensy 3.1
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!
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Electronic Animated Eyes using Teensy 3.1
Comment out this line, around line #47 in the Arduino sketch:
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.
Code: Select all
#define TRACKING // If enabled, eyelid tracks pupil
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.
- Dragten
- Posts: 10
- Joined: Tue Feb 23, 2016 7:51 am
Re: Electronic Animated Eyes using Teensy 3.1
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.
I need to use a dome of a bigger size and STL files are not possible to edit in Solidworks.
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Electronic Animated Eyes using Teensy 3.1
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.
- Dragten
- Posts: 10
- Joined: Tue Feb 23, 2016 7:51 am
Re: Electronic Animated Eyes using Teensy 3.1
Thank you very much, you are always so incredibly helpful!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.
- Dragten
- Posts: 10
- Joined: Tue Feb 23, 2016 7:51 am
Re: Electronic Animated Eyes using Teensy 3.1
Mister Burges, a hypothetical question:
Is it technically possibly to use a potentiometer to control the squint of the eyes?
Is it technically possibly to use a potentiometer to control the squint of the eyes?
Please be positive and constructive with your questions and comments.