Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By sumotoy
#35914 Sorry but I cannot reproduce problem, I'm running at full speed (even at 160Mhz), no issues on the 4 modules I have (everyone has the display), I should have an access to a livecam to proof this but believe me it's true...
On arduino I flashed with:
- NodeMCU 1.0 (ESP12-E Module)
- CPU Frequency: 80Mh (or even 160Mhz)
- Flash Size: 4M (1M SPIFF)
The display hast RST connected to 3v3 and I'm using CS to pin 16 and DC to pin 2
I have used this sketch, it dinamically change rotation as well:
Code: Select all/*
This sketch shows how to use other fonts
and some new text commands

 */
#include <SPI.h>
#include <TFT_ILI9163C.h>
#include "_fonts/unborn_small.c"
/*
 fonts are inside _fonts folder and should be declared here
 notice that default font it's arial x2.c and it's always loaded!
 You can use only fonts prepared to be used with sumotoy libraries
 that uses LPGO Text rendering like:
https://github.com/sumotoy/TFT_ILI9163C/tree/Pre-Release-1.0r4
https://github.com/sumotoy/RA8875/tree/0.70b11
https://github.com/sumotoy/OLED_pictivaWide
*/

#if !defined(_ILI9163_NEWFONTRENDER)
#error "you have to enable new LPGO rendering engine inside settings!"
#endif


#define __CS  16  //(D0)
#define __DC  2   //(D1)

TFT_ILI9163C tft = TFT_ILI9163C(__CS, __DC);//we dont use rst, tie reset pin to 3v3

void setup() {
  Serial.begin(115200);
  Serial.print("\nstarted\n");
  tft.begin();
  /*
   after this command the library has already set several
   things as default:
   tft.clearScreen();//screen cleared with black
   tft.setRotation(0);//no rotation
   tft.setTextScale(1);//no scale
   tft.setCursor(0,0);
   tft.setTextWrap(true);//text will wrap to a new line automatically
   tft.setTextColor(WHITE,WHITE);//background transparent
   //default internal font loaded arial_x2
   This allow you to start writing immediately without
   need to set anything.
   */

}

uint8_t rot = 0;

void loop() {
  tft.clearScreen();
  tft.setRotation(rot);
  tft.setFontInterline(0);
  tft.setCharSpacing(0);
  tft.setTextScale(1);
  tft.setTextColor(WHITE);
  tft.setFont(&unborn_small);//this will load the font
  tft.println("Hello world!");//this will add a new line as well
  tft.setTextScale(3);//now multiply x 3 the scale
  tft.println("Hello world!");//the wrap on will split words in 2 lines
  tft.setInternalFont();//now switch to internal font
  tft.setTextScale(2);//smaller
  tft.setFontInterline(2);//this will be active after the println!
  tft.setTextColor(random(0x6000,0xFFFF));
  tft.println("Hello world!");
  tft.setCharSpacing(1);//add an extra pixel between chars
  tft.setTextColor(random(0x6000,0xFFFF), random(0x1010,0x9090)); //set a background inside font
  tft.println("Hello world!");
  delay(1000);
  if (rot >= 3) {
    rot = 0;
  } else {
    rot++;
  }
}


The error it's really generic to me, but googling the 2 errors bring me only to firmware issues (and some inconsistency power issues that I don't trust).
Here's what I can suggest you, it's not library related but helped me in many situations.
1) Are you using the same pin I'm using?
2) If you are using IDE 1.66, switch back to 1.65.
3) Maybe you updated to rc2 recently from an old version? If yes, I strongly suggest remove completely ESP8266 (if you are on windows, remove also ESP8266 folder inside AppData/Roaming/Arduino15/packages/esp8266), close IDE, reopen it and reinstall ESP8266 staging, then close and reopen.
User avatar
By sumotoy
#35915 I also know that those errors can be caused by corrupted SDK config data. It happened one time to me and I solved by reflashing the module with v1.3.0.2 AT Firmware.bin and ESP_DOWNLOAD_TOOL_V2.4.
User avatar
By micropet
#35972 Thank you very much for your efforts.
We have almost the same configuration.

- NodeMCU 1.0 (ESP12-E modules)
- CPU Frequency: tested 80Mh and160Mhz
- Flash Size: 4M (1M Spiff)
The display have RST connected to + 3v3
CS to pin 16 and DC to pin 2 (D1 you write in the Sketch, but it's D4)

The IDE 1.6.5-r5 is freshly installed. The ESP Source is also newly installed from iggrs Github. The old ESP source is previously deleted.

Arduino15 is completely deleted.
The 3.3V voltage is stable at 3,298 volts.
Meanwhile, I have tried your example on 5 Nodemcu boards. All do the Reset..

The display shows a part of the text - then comes the reset.

The only difference I see is: I've never tested a staging version, I always use the Github Version.
The AT software I never reflashed. I could still try.

Peter