Teensyduino 1.23 Beta #2 Available

Status
Not open for further replies.

Paul

Administrator
Staff member
Here is a first beta test for Teensyduino 1.23:



Edit: old beta test linkes removed. Full non-beta release is here:
http://www.pjrc.com/teensy/td_download.html



Please give this a try and report any bugs. Try to include a sample program that reproduces the problem!

These are the changes since Teensyduino 1.23-beta1:


  • Support for Arduino 1.6.4
  • Update OSC library
  • analogWriteFrequency() now allow precise sub-1 Hz input
  • Fix SPI FIFO bug in ILI9341_t3
 
I can't install Teensyduino over a new Arduino 1.6.4 installation. (win 7 64 bit, install dir: C:\Program Files (x86)\Arduino, teensyduino installer with admin rights)
According to the Help window from the Teensyduino installer, only Arduino 1.6.3 and older are supported.

Directory: C:/Program Files (x86)/Arduino/libraries/
Checking Arduino 1.0.6:
file: "arduino.exe" missing
Does not match Arduino 1.0.6
Checking Arduino 1.6.1-j7:
file: "arduino.exe" missing
Does not match Arduino 1.6.1-j7
Checking Arduino 1.6.1:
file: "arduino.exe" missing
Does not match Arduino 1.6.1
Checking Arduino 1.6.2:
file: "arduino.exe" missing
Does not match Arduino 1.6.2
Checking Arduino 1.6.3:
file: "arduino.exe" missing
Does not match Arduino 1.6.3

edit: The download links for windows and mac are for beta 1 and not beta 2

Mac OS-X:
http://www.pjrc.com/teensy/td_123-beta2/teensyduino.dmg

Windows:
http://www.pjrc.com/teensy/td_123-beta2/teensyduino.exe
 
Last edited:
Maybe someday Teensy will use their installer, but currently Teensy requires many features which are not officially part of the Arduino IDE and can't be installed by their Boards Manager.
 
Pulled IDE.zip 1.6.4 and TD_1.23b2 and installed on Win8.1x64 and got a working verify. Moved my Teensy's to other computers so didn't run anything - four piled up here. Will drag one back or open another and post if trouble.

Is "unofficial board" just a .cc way (part) of excluding boards such as the .org units? Making them register as 'unreal'?
 
Maybe someday Teensy will use their installer, but currently Teensy requires many features which are not officially part of the Arduino IDE and can't be installed by their Boards Manager.

I wondered if that was the case. I copied the teensy and tools folder with just the teensy additions to the hardware folder in my sketchbook. I fired up the IDE and it was recognized right away. It compiled the code but it failed when it tried to define the rtc symbol. I've always used the __DATE__ __TIME__ macros to set the clock for my DS1307 chips.

There have been quite a few updates to the IDE recently and with every update do I need to rerun the Teensy Installer. Does the Teensy Installer replace core jar files or just drop a few extra ones in the lib folder. Is the source code available for the installer? Then I could find out myself.

BTW I'm using Ubuntu 14.04 LTS w/Xfce4. It originally had Unity but I quickly grew tired of it's lack of customization options.

The Teensyduino 1.23-Beta-2 works like a champ. I have yet to solder any headers to the board and so far I have only played with the built-in LED. Basic functionality is there, it compiles, launches the loader, and uploads when compilation is done. It's a little annoying to press the reset button every time I want to reprogram it but I've been spoiled by the Uno's auto reset. The Micro has reset functionality with a quick open and close at 1200 baud but I'm not sure if that could be done on the Teensy. I'm not familiar with the chip so my opinion is mostly ranting. It's a very nice board and very compact considering the amount of functionality on the little thing. The board I have is the Teensy 3.1 and I think it's a cheaper alternative to the Due and as I said before a lot smaller.

Code:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Code:
3.13.0-52-generic #86-Ubuntu SMP Mon May 4 04:32:59 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
 
The Micro has reset functionality with a quick open and close at 1200 baud but I'm not sure if that could be done on the Teensy.

You can reset the Teensy the same way (assuming it's running in serial mode, and not HID) but 134 is the speed you need to trigger it.
 
Is "unofficial board" just a .cc way (part) of excluding boards such as the .org units? Making them register as 'unreal'?

It looks that way. Specifically, if you are using a board made by Adafruit or Sparkfun or Seedstudio or whatever, it is not an "unofficial board". Likewise none of the teensies are flagged as "unofficial". If you bought an Arduino-branded board from one of their many authorised distributors and it happens to have hardware with the Arduino.org new USB VID/PID then it gets flagged as "unofficial". A great way to penalize their users who purchased in good faith while not impacting at all Arduino.org who already have the money for the boards they made and sold.

Sorry, bit off topic for this thread. I haven't installed the beta, I went back to using Arduino 1.0.6 which is stable and solid. 1.5.x may have "come out of beta" with 1.6.x but it still feels like beta-quality to me. I lost a lot of confidence in Arduino.cc when they pulled that trick with a ton of months-old but hidden Github changes plus a release, all within a day or two. They need to get their act together.
 
Something isn't quite right with your installation:

It's a little annoying to press the reset button every time I want to reprogram it but I've been spoiled by the Uno's auto reset. The Micro has reset functionality with a quick open and close at 1200 baud but I'm not sure if that could be done on the Teensy.

Teensy does auto reset. Or it's supposed to. If Teensy is running one of the USB Types with Serial, the auto reset command it a baud rate set of 134. It's pretty much the same as Micro using 1200... except 134 baud is a much less common setting that most program don't offer from their menus.

If Teensy is running one of the non-Serial settings (eg, you chose it in Tools > USB Type before uploading), the auto-reset is done by sending a HID feature report.

Linux is tough to support, because there's so many distros with slightly different setups. I really only test Ubuntu 12.04 and 14.04. But this stuff should "just work" on modern udev-based systems.
 
If you bought an Arduino-branded board from one of their many authorised distributors and it happens to have hardware with the Arduino.org new USB VID/PID then it gets flagged as "unofficial". A great way to penalize their users who purchased in good faith while not impacting at all Arduino.org who already have the money for the boards they made and sold.

Arduino LLC (the real Arduino) removed all that code from 1.6.4.

Some time ago, they pushed a commit that disabled it. Just before the 1.6.4 release, they made a commit that completely removed every last line of that code, even though they'd already disabled it.

Several days ago, they mentioned 1.6.4 would be released quickly. I asked them to consider asking the community to do more beta testFederico Fissore wrote:

Unfortunately this is not yet the time for such a wide feedback period. Legal stuff urges us to make a release. But we have spread the word on social networks [1] [2]

Hopefully, next time we won't have urgencies, thus allowing for a longer user testing.

This is really just a guess on my part, but I have a hunch "legal stuff urges us to make a release" likely means they lost some legal battle and a court (perhaps in Italy where court records aren't public) ordered them to take that out? Maybe? Really, this is just sheer speculation on my part.

But I can tell you, and I believe anyone who's worked much with the Arduino IDE's java code would agree, fully removing stuff that's already disabled, so there's no leftover cruft laying around, is VERY uncharacteristic of Arduino's normal coding, ugh... style. Yeah, that's it, let's use the word "style". ;)
 
Installed fine over a fresh Arduino 1.6.4. I notice that the secondary menus are now persistent and don't constantly reset to Serial, US English, etc which is good.

I also see duplicate library alerts, such as
Multiple libraries were found for "MIDI.h"
Used: D:\Arduino\sketches\libraries\MIDI
Not used: D:\Arduino\arduino-1.6.4-td123-b2\hardware\teensy\avr\libraries\MIDI
which is also good. No issues found after a small number of tests. Edit: Windows 7
 
Last edited:
It's a little annoying to press the reset button every time I want to reprogram it

Unless you have multiple active Teensy units online - as Paul notes 'Sketch >> Verify/Compile' does auto-Upload with Ctrl+R. With Multiples the problem is selecting which one gets uploaded.
 
Hi Paul;

A modest suggestion if I can. Would it be possible to get you to embedded version numbers into the downloads file names? It removes confusion as to what I have locally, in this case on a Mac OS system but I think it is fair to say it applies to other platforms. Of course on the mac you could embedded a file into the DMG to identify the version but that wouldn't be as handy on other systems.

I noticed you had a linking error earlier, embedded version numbers in the filenames might have helped here.
 
Issue with Display examples

Hello,

I was working through various examples this weekend and found something interesting specifically with the graphics display. I have the display sold by pjrc as well as the adafruit 2.8" touch screen In one case I have the touch display connected to a T3 with a pjrc audio shield using alternate wiring described on the pjrc website for the graphics display.

My observable, if I use the graphics test example for adafruit I see the display working, if I use the graphics test example for the 'highly optimized t3 library I get no response from the display.

Obviously there is a difference in the libraries. My quick questions would be:
Is anyone else using the T3 specific libraries and having success? or should I just use the Adafruit version?
Is there any major difference in the Adafruit vs T3 library related to performance? or have the changes Paul made been incorporated into the adafruit library?

I started out testing with a clean install of 1.6.4 along with the teensyduino from the links above. after I determined the above behavior. I tried on my Arduino 1.6.3 installation with similar results and found an older 1.6.1 version, and got the same results.

here's the code that works with the display, it is the 'adafruit' example with some pinout changes to accommodate the audiocard being used.

Note that I also tested with a T3_0 no audio card but still using these alternate pin selections

Here's the T3 example: I only modified pin assignments, and the changes are the same to both the examples:

Code:
/***************************************************
  This is our GFX example for the Adafruit ILI9341 Breakout and Shield
  ----> http://www.adafruit.com/products/1651

  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/


#include "SPI.h"
#include "ILI9341_t3.h"

// For the Adafruit shield, these are the default.
#define TFT_DC 20
#define TFT_CS 21

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC);

void setup() {
  SPI.setMOSI(7);
  SPI.setSCK(14);

  tft.begin();
  tft.fillScreen(ILI9341_BLACK);
  tft.setTextColor(ILI9341_YELLOW);
  tft.setTextSize(2);
  tft.println("Waiting for Arduino Serial Monitor...");

  Serial.begin(9600);
  while (!Serial) ; // wait for Arduino Serial Monitor
  Serial.println("ILI9341 Test!"); 

  // read diagnostics (optional but can help debug problems)
  uint8_t x = tft.readcommand8(ILI9341_RDMODE);
  Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDMADCTL);
  Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDPIXFMT);
  Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDIMGFMT);
  Serial.print("Image Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDSELFDIAG);
  Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX); 
  
  Serial.println(F("Benchmark                Time (microseconds)"));

  Serial.print(F("Screen fill              "));
  Serial.println(testFillScreen());
  delay(200);

  Serial.print(F("Text                     "));
  Serial.println(testText());
  delay(600);

  Serial.print(F("Lines                    "));
  Serial.println(testLines(ILI9341_CYAN));
  delay(200);

  Serial.print(F("Horiz/Vert Lines         "));
  Serial.println(testFastLines(ILI9341_RED, ILI9341_BLUE));
  delay(200);

  Serial.print(F("Rectangles (outline)     "));
  Serial.println(testRects(ILI9341_GREEN));
  delay(200);

  Serial.print(F("Rectangles (filled)      "));
  Serial.println(testFilledRects(ILI9341_YELLOW, ILI9341_MAGENTA));
  delay(200);

  Serial.print(F("Circles (filled)         "));
  Serial.println(testFilledCircles(10, ILI9341_MAGENTA));

  Serial.print(F("Circles (outline)        "));
  Serial.println(testCircles(10, ILI9341_WHITE));
  delay(200);

  Serial.print(F("Triangles (outline)      "));
  Serial.println(testTriangles());
  delay(200);

  Serial.print(F("Triangles (filled)       "));
  Serial.println(testFilledTriangles());
  delay(200);

  Serial.print(F("Rounded rects (outline)  "));
  Serial.println(testRoundRects());
  delay(200);

  Serial.print(F("Rounded rects (filled)   "));
  Serial.println(testFilledRoundRects());
  delay(200);

  Serial.println(F("Done!"));

}


void loop(void) {
  for(uint8_t rotation=0; rotation<4; rotation++) {
    tft.setRotation(rotation);
    testText();
    delay(1000);
  }
}

unsigned long testFillScreen() {
  unsigned long start = micros();
  tft.fillScreen(ILI9341_BLACK);
  tft.fillScreen(ILI9341_RED);
  tft.fillScreen(ILI9341_GREEN);
  tft.fillScreen(ILI9341_BLUE);
  tft.fillScreen(ILI9341_BLACK);
  return micros() - start;
}

unsigned long testText() {
  tft.fillScreen(ILI9341_BLACK);
  unsigned long start = micros();
  tft.setCursor(0, 0);
  tft.setTextColor(ILI9341_WHITE);  tft.setTextSize(1);
  tft.println("Hello World!");
  tft.setTextColor(ILI9341_YELLOW); tft.setTextSize(2);
  tft.println(1234.56);
  tft.setTextColor(ILI9341_RED);    tft.setTextSize(3);
  tft.println(0xDEADBEEF, HEX);
  tft.println();
  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(5);
  tft.println("Groop");
  tft.setTextSize(2);
  tft.println("I implore thee,");
  tft.setTextSize(1);
  tft.println("my foonting turlingdromes.");
  tft.println("And hooptiously drangle me");
  tft.println("with crinkly bindlewurdles,");
  tft.println("Or I will rend thee");
  tft.println("in the gobberwarts");
  tft.println("with my blurglecruncheon,");
  tft.println("see if I don't!");
  return micros() - start;
}

unsigned long testLines(uint16_t color) {
  unsigned long start, t;
  int           x1, y1, x2, y2,
                w = tft.width(),
                h = tft.height();

  tft.fillScreen(ILI9341_BLACK);

  x1 = y1 = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t     = micros() - start; // fillScreen doesn't count against timing

  tft.fillScreen(ILI9341_BLACK);

  x1    = w - 1;
  y1    = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;

  tft.fillScreen(ILI9341_BLACK);

  x1    = 0;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;

  tft.fillScreen(ILI9341_BLACK);

  x1    = w - 1;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);

  return micros() - start;
}

unsigned long testFastLines(uint16_t color1, uint16_t color2) {
  unsigned long start;
  int           x, y, w = tft.width(), h = tft.height();

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(y=0; y<h; y+=5) tft.drawFastHLine(0, y, w, color1);
  for(x=0; x<w; x+=5) tft.drawFastVLine(x, 0, h, color2);

  return micros() - start;
}

unsigned long testRects(uint16_t color) {
  unsigned long start;
  int           n, i, i2,
                cx = tft.width()  / 2,
                cy = tft.height() / 2;

  tft.fillScreen(ILI9341_BLACK);
  n     = min(tft.width(), tft.height());
  start = micros();
  for(i=2; i<n; i+=6) {
    i2 = i / 2;
    tft.drawRect(cx-i2, cy-i2, i, i, color);
  }

  return micros() - start;
}

unsigned long testFilledRects(uint16_t color1, uint16_t color2) {
  unsigned long start, t = 0;
  int           n, i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  n = min(tft.width(), tft.height());
  for(i=n; i>0; i-=6) {
    i2    = i / 2;
    start = micros();
    tft.fillRect(cx-i2, cy-i2, i, i, color1);
    t    += micros() - start;
    // Outlines are not included in timing results
    tft.drawRect(cx-i2, cy-i2, i, i, color2);
  }

  return t;
}

unsigned long testFilledCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2;

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(x=radius; x<w; x+=r2) {
    for(y=radius; y<h; y+=r2) {
      tft.fillCircle(x, y, radius, color);
    }
  }

  return micros() - start;
}

unsigned long testCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int           x, y, r2 = radius * 2,
                w = tft.width()  + radius,
                h = tft.height() + radius;

  // Screen is not cleared for this one -- this is
  // intentional and does not affect the reported time.
  start = micros();
  for(x=0; x<w; x+=r2) {
    for(y=0; y<h; y+=r2) {
      tft.drawCircle(x, y, radius, color);
    }
  }

  return micros() - start;
}

unsigned long testTriangles() {
  unsigned long start;
  int           n, i, cx = tft.width()  / 2 - 1,
                      cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  n     = min(cx, cy);
  start = micros();
  for(i=0; i<n; i+=5) {
    tft.drawTriangle(
      cx    , cy - i, // peak
      cx - i, cy + i, // bottom left
      cx + i, cy + i, // bottom right
      tft.color565(0, 0, i));
  }

  return micros() - start;
}

unsigned long testFilledTriangles() {
  unsigned long start, t = 0;
  int           i, cx = tft.width()  / 2 - 1,
                   cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(i=min(cx,cy); i>10; i-=5) {
    start = micros();
    tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      tft.color565(0, i, i));
    t += micros() - start;
    tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      tft.color565(i, i, 0));
  }

  return t;
}

unsigned long testRoundRects() {
  unsigned long start;
  int           w, i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  w     = min(tft.width(), tft.height());
  start = micros();
  for(i=0; i<w; i+=6) {
    i2 = i / 2;
    tft.drawRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(i, 0, 0));
  }

  return micros() - start;
}

unsigned long testFilledRoundRects() {
  unsigned long start;
  int           i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(i=min(tft.width(), tft.height()); i>20; i-=6) {
    i2 = i / 2;
    tft.fillRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(0, i, 0));
  }

  return micros() - start;
}


Here's the example I see output on the displays:

Code:
/***************************************************
  This is our GFX example for the Adafruit ILI9341 Breakout and Shield
  ----> http://www.adafruit.com/products/1651

  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/


#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

// When using the Audio shield, these are the default.
#define TFT_DC 20
#define TFT_CS 21

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// If using the breakout, change pins as desired
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

void setup() {
  Serial.begin(9600);
  Serial.println("ILI9341 Test!"); 
  SPI.setMOSI(7);
  SPI.setSCK(14);
 
  tft.begin();

  // read diagnostics (optional but can help debug problems)
  uint8_t x = tft.readcommand8(ILI9341_RDMODE);
  Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDMADCTL);
  Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDPIXFMT);
  Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDIMGFMT);
  Serial.print("Image Format: 0x"); Serial.println(x, HEX);
  x = tft.readcommand8(ILI9341_RDSELFDIAG);
  Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX); 
  
  Serial.println(F("Benchmark                Time (microseconds)"));

  Serial.print(F("Screen fill              "));
  Serial.println(testFillScreen());
  delay(500);

  Serial.print(F("Text                     "));
  Serial.println(testText());
  delay(3000);

  Serial.print(F("Lines                    "));
  Serial.println(testLines(ILI9341_CYAN));
  delay(500);

  Serial.print(F("Horiz/Vert Lines         "));
  Serial.println(testFastLines(ILI9341_RED, ILI9341_BLUE));
  delay(500);

  Serial.print(F("Rectangles (outline)     "));
  Serial.println(testRects(ILI9341_GREEN));
  delay(500);

  Serial.print(F("Rectangles (filled)      "));
  Serial.println(testFilledRects(ILI9341_YELLOW, ILI9341_MAGENTA));
  delay(500);

  Serial.print(F("Circles (filled)         "));
  Serial.println(testFilledCircles(10, ILI9341_MAGENTA));

  Serial.print(F("Circles (outline)        "));
  Serial.println(testCircles(10, ILI9341_WHITE));
  delay(500);

  Serial.print(F("Triangles (outline)      "));
  Serial.println(testTriangles());
  delay(500);

  Serial.print(F("Triangles (filled)       "));
  Serial.println(testFilledTriangles());
  delay(500);

  Serial.print(F("Rounded rects (outline)  "));
  Serial.println(testRoundRects());
  delay(500);

  Serial.print(F("Rounded rects (filled)   "));
  Serial.println(testFilledRoundRects());
  delay(500);

  Serial.println(F("Done!"));

}


void loop(void) {
  for(uint8_t rotation=0; rotation<4; rotation++) {
    tft.setRotation(rotation);
    testText();
    delay(1000);
  }
}

unsigned long testFillScreen() {
  unsigned long start = micros();
  tft.fillScreen(ILI9341_BLACK);
  tft.fillScreen(ILI9341_RED);
  tft.fillScreen(ILI9341_GREEN);
  tft.fillScreen(ILI9341_BLUE);
  tft.fillScreen(ILI9341_BLACK);
  return micros() - start;
}

unsigned long testText() {
  tft.fillScreen(ILI9341_BLACK);
  unsigned long start = micros();
  tft.setCursor(0, 0);
  tft.setTextColor(ILI9341_WHITE);  tft.setTextSize(1);
  tft.println("Hello World!");
  tft.setTextColor(ILI9341_YELLOW); tft.setTextSize(2);
  tft.println(1234.56);
  tft.setTextColor(ILI9341_RED);    tft.setTextSize(3);
  tft.println(0xDEADBEEF, HEX);
  tft.println();
  tft.setTextColor(ILI9341_GREEN);
  tft.setTextSize(5);
  tft.println("Groop");
  tft.setTextSize(2);
  tft.println("I implore thee,");
  tft.setTextSize(1);
  tft.println("my foonting turlingdromes.");
  tft.println("And hooptiously drangle me");
  tft.println("with crinkly bindlewurdles,");
  tft.println("Or I will rend thee");
  tft.println("in the gobberwarts");
  tft.println("with my blurglecruncheon,");
  tft.println("see if I don't!");
  return micros() - start;
}

unsigned long testLines(uint16_t color) {
  unsigned long start, t;
  int           x1, y1, x2, y2,
                w = tft.width(),
                h = tft.height();

  tft.fillScreen(ILI9341_BLACK);

  x1 = y1 = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t     = micros() - start; // fillScreen doesn't count against timing

  tft.fillScreen(ILI9341_BLACK);

  x1    = w - 1;
  y1    = 0;
  y2    = h - 1;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;

  tft.fillScreen(ILI9341_BLACK);

  x1    = 0;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = w - 1;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);
  t    += micros() - start;

  tft.fillScreen(ILI9341_BLACK);

  x1    = w - 1;
  y1    = h - 1;
  y2    = 0;
  start = micros();
  for(x2=0; x2<w; x2+=6) tft.drawLine(x1, y1, x2, y2, color);
  x2    = 0;
  for(y2=0; y2<h; y2+=6) tft.drawLine(x1, y1, x2, y2, color);

  return micros() - start;
}

unsigned long testFastLines(uint16_t color1, uint16_t color2) {
  unsigned long start;
  int           x, y, w = tft.width(), h = tft.height();

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(y=0; y<h; y+=5) tft.drawFastHLine(0, y, w, color1);
  for(x=0; x<w; x+=5) tft.drawFastVLine(x, 0, h, color2);

  return micros() - start;
}

unsigned long testRects(uint16_t color) {
  unsigned long start;
  int           n, i, i2,
                cx = tft.width()  / 2,
                cy = tft.height() / 2;

  tft.fillScreen(ILI9341_BLACK);
  n     = min(tft.width(), tft.height());
  start = micros();
  for(i=2; i<n; i+=6) {
    i2 = i / 2;
    tft.drawRect(cx-i2, cy-i2, i, i, color);
  }

  return micros() - start;
}

unsigned long testFilledRects(uint16_t color1, uint16_t color2) {
  unsigned long start, t = 0;
  int           n, i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  n = min(tft.width(), tft.height());
  for(i=n; i>0; i-=6) {
    i2    = i / 2;
    start = micros();
    tft.fillRect(cx-i2, cy-i2, i, i, color1);
    t    += micros() - start;
    // Outlines are not included in timing results
    tft.drawRect(cx-i2, cy-i2, i, i, color2);
  }

  return t;
}

unsigned long testFilledCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2;

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(x=radius; x<w; x+=r2) {
    for(y=radius; y<h; y+=r2) {
      tft.fillCircle(x, y, radius, color);
    }
  }

  return micros() - start;
}

unsigned long testCircles(uint8_t radius, uint16_t color) {
  unsigned long start;
  int           x, y, r2 = radius * 2,
                w = tft.width()  + radius,
                h = tft.height() + radius;

  // Screen is not cleared for this one -- this is
  // intentional and does not affect the reported time.
  start = micros();
  for(x=0; x<w; x+=r2) {
    for(y=0; y<h; y+=r2) {
      tft.drawCircle(x, y, radius, color);
    }
  }

  return micros() - start;
}

unsigned long testTriangles() {
  unsigned long start;
  int           n, i, cx = tft.width()  / 2 - 1,
                      cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  n     = min(cx, cy);
  start = micros();
  for(i=0; i<n; i+=5) {
    tft.drawTriangle(
      cx    , cy - i, // peak
      cx - i, cy + i, // bottom left
      cx + i, cy + i, // bottom right
      tft.color565(0, 0, i));
  }

  return micros() - start;
}

unsigned long testFilledTriangles() {
  unsigned long start, t = 0;
  int           i, cx = tft.width()  / 2 - 1,
                   cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(i=min(cx,cy); i>10; i-=5) {
    start = micros();
    tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      tft.color565(0, i, i));
    t += micros() - start;
    tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i,
      tft.color565(i, i, 0));
  }

  return t;
}

unsigned long testRoundRects() {
  unsigned long start;
  int           w, i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  w     = min(tft.width(), tft.height());
  start = micros();
  for(i=0; i<w; i+=6) {
    i2 = i / 2;
    tft.drawRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(i, 0, 0));
  }

  return micros() - start;
}

unsigned long testFilledRoundRects() {
  unsigned long start;
  int           i, i2,
                cx = tft.width()  / 2 - 1,
                cy = tft.height() / 2 - 1;

  tft.fillScreen(ILI9341_BLACK);
  start = micros();
  for(i=min(tft.width(), tft.height()); i>20; i-=6) {
    i2 = i / 2;
    tft.fillRoundRect(cx-i2, cy-i2, i, i, i/8, tft.color565(0, i, 0));
  }

  return micros() - start;
}

I am currently using the adafruit library and moving on to try other functionality, but wanted to know if the t3 version should work and if it is supposed to be faster (if it did work.)

Cheers Kb
 
A modest suggestion if I can. Would it be possible to get you to embedded version numbers into the downloads file names?

Please post this here:

https://forum.pjrc.com/forums/4-Suggestions-amp-Bug-Reports

For at least the next couple months, I'm concentrating on a number of important features, where the last thing I want to do is also fiddle with changes to how I build and release the software.

But farther out, this probably make good sense. Please post it on that suggestions area. Posted here, it'll never be seen again!
 
Hello,

I was working through various examples this weekend and found something interesting specifically with the graphics display. I have the display sold by pjrc as well as the adafruit 2.8" touch screen In one case I have the touch display connected to a T3 with a pjrc audio shield using alternate wiring described on the pjrc website for the graphics display.

My observable, if I use the graphics test example for adafruit I see the display working, if I use the graphics test example for the 'highly optimized t3 library I get no response from the display.
...

Code:
/***************************************************
  This is our GFX example for the Adafruit ILI9341 Breakout and Shield
  ----> http://www.adafruit.com/products/1651

  Check out the links above for our tutorials and wiring diagrams
  These displays use SPI to communicate, 4 or 5 pins are required to
  interface (RST is optional)
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/


#include "SPI.h"
#include "ILI9341_t3.h"

// For the Adafruit shield, these are the default.
#define TFT_DC 20
#define TFT_CS 21

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC);

void setup() {
  SPI.setMOSI(7);
  SPI.setSCK(14);


  tft.begin();
...

I am currently using the adafruit library and moving on to try other functionality, but wanted to know if the t3 version should work and if it is supposed to be faster (if it did work.)

Cheers Kb

Sorry, this is probably an issue with one of the later deltas that I did for the library. In particular I was trying to make it easier to pass in the alternate SPI pins into the constructor and if no spi pins were passed in then it assumes (and sets) the SPI pins to the default pins, which the tft.begin call will do.

A couple of fixes can happen. Use the long form of the constructor and pass in the SPI pins.

Or Could make a updated delta to the ILI9341 library, which if short form constructor, don't assume and set default IO pins. (Not hard). Again this was done to in theory make it easier and also add the ability for attempting to allow it to be used on SPI2 on the TLC, if/when we ever try to merge in TLC support.

Kurt
 
Does the new version of Teensyduino still support the older IDE versions ok, eg v1.0.5?

I've not updated to anything past v1.0.5 because the installers past that appear to require you to remove "all" previous IDE versions from your HD anymore, and I have many library patches I don't wish to lose.

I've also not seen any "compelling" reason to want to switch IDEs, in any case. The older stuff ain't necessarily broken. The new IDEs always come with multiple new bugs.
 
I believe that Teensyduino still supports the old builds, but I am not sure about 1.0.5. It does support 1.0.6.

Personally I like the updated 1.6.x builds as there have been a few things fixed over the years. But I keep 1.0.6 installed using default install (Windows 7) and I keep the latest 1.6.x build installed using zip file version.

Kurt
 
Teensyduino 1.21 was the last version to support Arduino 1.0.5.

I decided to drop 1.0.5 because quite a few improvements had been added in my 1.0.6 patches. Backporting to old versions takes a lot of extra work, so I usually drop old versions after a while. 1.0.5 and 1.0.6 are very similar too, so there seemed to be little point in extra effort to keep 1.0.5 support alive.

But I'm planning to keep 1.0.6 and 1.6.1 for quite some time. Obviously 1.0.6 is the last of the 1.0.x series, and 1.6.1 is the last version that will ever support Mac OS-X 10.6.
 
I've not updated to anything past v1.0.5 because the installers past that appear to require you to remove "all" previous IDE versions from your HD anymore, and I have many library patches I don't wish to lose.

Don't ever use the Arduino installers, on Windows. Use the zip instead. You can have as many Arduino versions as you want (I currently have 7, probably time to cull a few).
 
Thanks Kurt I changed to this

Code:
ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC,255,7,14,8);
...and It's working again.
I get this weird white screen with one of the test effects. I had that resolved before, I'll need to figure that out again. I should do this more frequently or keep better notes...

Thanks again. Kb

one quick update. The graphic test runs fine on the pjrc (offered) display on a T3.0 but the Ada fruit touch has an issue with the 'lines' test (sort of a inverse mode on the display) the rest of the test work well.

Will post an update If I find out what's up with lines...
Kb
 
Last edited:
Status
Not open for further replies.
Back
Top