Arduino code is slow

I am running an example code touchpaint.ino , in the beginning it was fast and if i press the reset button the display shows grey lines alone ,some times when i pressed reset two times it worked and sometimes it was not.later when i was keep on trying the example code became slow.Even i changed to 256Mhz and ~320Mhz.It is still slow like aUNO board functioning under 16Mhz.

If i run through the pure C code from terminal Upload .It is fast as usual.

what is the problem?

why arduino code became slow?

Another Doubt,

For me the touch response for touchpaint.ino code is mirrored like if i touch down it prints in the top likewise left and right.
I had read a solution from arduino forum, adding setRotation(2) before begin().It worked.
But if i want to use 1,3,4? The problem still persists.

I am using 2.8" ili9341 touch screen breakout board and stmpe610

Perhaps you may want to take a look at the SimpleTouchscreen library that is part of the Cinco Windows package.

1 Like

[SOLVED] for slow arduino code.
I was using a typical Adafruit_ili9341 library.Just changed .cpp and .h files with Adafruit_ili9341_freedom-e-sdk from Adafruit_ILI9341 repo.Perfect! now.

Since i m using adafruit 2.8" inch resistive touch breakout display and stmpe610 controller.I do not know whether i could use SimpleTouchscreen library.
Thanks anyways.