Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By froussel
#80192 Hi and happy new year,

With Arduino IDE and ESP8266
Code: Select all#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
#include <Wire.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <SD.h>

/* ESP8266 SD(adaptateur sd --> microsd)
*

D5 --- CLK
D6 --- MISO
D7 --- MOSI
3.3v 3.3v
GNd GND
D1 --- CS
testscreen LCD UC1701x
 Screen      ESP8266
5 LedA NC
6 Vss GND
7 Vdd 3.3v
8 SCLK D5 SCK
9 SDA D7 MOSI
10 RS D2 dc
11 Reset D3 reset
12 CS D8
*/
U8G2_UC1701_MINI12864_F_4W_SW_SPI u8g2(U8G2_R2, /* clock=/ D5, / data=/ D7, / cs=/ D8, / dc=/ D2, / reset=*/ D3);

const int CS_SD = D1; // for SD

void setup(void)
{ u8g2.begin();
u8g2.firstPage();
do { u8g2.setFont(u8g2_font_courB14_tr);
u8g2.drawStr(1,15,"Ecran OK");
} while ( u8g2.nextPage() );
Serial.begin (115200);
Serial.println(" ");
Serial.println(" Initialisation écran passée ");
delay(1000);
Serial.println("Initialisation SD card...");
if (!SD.begin(CS_SD)) // SD detectee ?
{ Serial.println("Pas de SD détectée");
u8g2.firstPage();
do { u8g2.setFont(u8g2_font_courB14_tr);
u8g2.drawStr(1,1,": Pas de SD");
} while ( u8g2.nextPage() );
Serial.println("Ici : rien n'a changé sur l'écran ");
return; }
}

void loop(void)
{
}

The second screen on the UC1701x is not displayed
The first screen remains displayed

I suspect a pb between the u8g2 library and SD library

A solution ? Please...
User avatar
By picstart1
#80209 I suspect the issue is with the LCD SPI chip select (CS) and the CS for the SD.
Most LCD packages embed low down the call to CS. You can choose the CS pin but the LCD package deep in the code chooses when to enable/disable it. Pins are few but use a separate pin for the LCD CS and the SD CS