Two Uncanny Eyes on same TFT display

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
branhamr
 
Posts: 20
Joined: Tue Jan 07, 2014 5:48 pm

Two Uncanny Eyes on same TFT display

Post by branhamr »

I am building a pair of Uncanny Eyes. Couldn't decide whether to use OLEO or TFT so am testing both. The OLEO works fine (default everything). With the same code except change to includes for different displays, the TFT is displaying the eye but wrapped part-way around the display horizontally. It reacts to wink, blink, and rt/left eye selection, but the iris stays out at the edges,Image

I believe I saw a similar image on this forum when I was researching this project, but can't find it now.

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Two Uncanny Eyes on same TFT display

Post by adafruit2 »

you cant use both types at once, im pretty sure. you have to pick one or the other

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

Re: Two Uncanny Eyes on same TFT display

Post by pburgess »

Is this using a Teensy 3.2 microcontroller? If so, the CPU speed should not be set faster than 72 MHz when using TFT displays.

If you've done that and it's still having problems, edit the file "config.h" and look for this line:

Code: Select all

  #define SPI_FREQ 24000000    // TFT: use max SPI (clips to 12 MHz on M0)
Try dialing it back a bit...maybe 16000000, or if still problematic, maybe 12000000. Any change?

User avatar
branhamr
 
Posts: 20
Joined: Tue Jan 07, 2014 5:48 pm

Re: Two Uncanny Eyes on same TFT display

Post by branhamr »

adafruit2 wrote:you cant use both types at once, im pretty sure. you have to pick one or the other
I understand that. I have two "customers" interested, working on spec and too cheap to buy a second Teensy. I have two variations of the sketch, each for either OLED or TFT. I am actually moving the Teensy from one end of the breadboard to the other, and recompiling and loading the relevant sketch. I lost patience yesterday and ordered another Teensy. Big spender!

Phil, I am using a Teensy 3.2 set to 72mHz per your project notes. The only difference between "uncanny_OLED" and "uncanny_TFT" are the include files in lines 38 & 39

Code: Select all

// Enable ONE of these #includes to specify the display type being used
//#include <Adafruit_SSD1351.h>  // OLED display library -OR-
#include <Adafruit_ST7735.h> // TFT display library (enable one only)
The above was just cut from "uncanny_TFT" just after I loaded it again.

I also tried the SPI_FREQ changes you suggested - no noticeable change.

I noticed that the split image I'm getting is basically a single eye skewed about 45 degrees and wrapped around side-to-side. The image below is a copy of the eye image from the Adafruit project - I loaded it into Photoshop, skewed it, then copied a second copy beside it. When you crop it to the width of a single image, it looks just like what I'm getting. (I left the gaps in the black background unfilled so you get a better idea of what I did.) Is there some way the horizontal pixel count could be off so the rows jog progressively over a bit each row. Does that make any sense/ If instead of 144 pixels, if you used 145 or 143 per row, it seems to me you would get that weird skewing thing??? My Photoshop version on left, TFT on right.
Image

Anyway, thanks to both of you for the help. I'll keep plugging away. The OLED is beautiful - just wish it weren't so much more expensive.

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

Re: Two Uncanny Eyes on same TFT display

Post by pburgess »

Strange. Does the startup logo look OK or does that come up skewed as well?

Sometimes this happens with long messy wires but slowing down the SPI speed usually takes care of that.

It's unlikely but just-conceivable-enough that the screen drivers may have changed since the units I have for testing here. So, long shot, but look for this line (around line 232):

Code: Select all

  eye[e].display->setAddrWindow(0, 0, 128, 128);
Try changing the 128,128 to either 129,129 or 127,127 and see if the image is more or less skewed, or possibly straight.

User avatar
branhamr
 
Posts: 20
Joined: Tue Jan 07, 2014 5:48 pm

Re: Two Uncanny Eyes on same TFT display

Post by branhamr »

I got a "fix" - no idea what it screws up elsewhere in the sketch, but -

at lines 231/232 -
changing

Code: Select all

#if defined(_ADAFRUIT_ST7735H_) || defined(_ADAFRUIT_ST77XXH_) // TFT
  eye[e].display->setAddrWindow(0, 0, 128, 128);
to

Code: Select all

#if defined(_ADAFRUIT_ST7735H_) || defined(_ADAFRUIT_ST77XXH_) // TFT
  eye[e].display->setAddrWindow(0, 0, [color=#BF0000]127, 127[/color]);
I now have a single eye correctly displayed. If anyone knows a down side to this, please straighten me out, but for now I'm happy!

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

Re: Two Uncanny Eyes on same TFT display

Post by pburgess »

If still encountering this issue: try updating the ST7735 library. Somewhere along the way the syntax of setAddrWindow() changed from x1,y1,x2,y2 to x1,y1,w,h.

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

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