So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By rudy
#58729
edwin wrote:Some of these replies confuse me a bit as I thought that the GPIO numbers did not directly translate to D numbers. Thus if one uses D0 and D2 as SDA and SCL the declaration Wire.begin(0,2) is wrong as that initializes pins D3 and D4.
If one uses D0 and D2, the initialization shld be Wire.begin(D0,D2) or Wire.begin(16,4)

Or have Icompletely misunderstood things??


I think what is confusing you is that some boards have relabeled the pins to something other than what the ESP8266 chip designates them. The ESP8266 modules have some of it's IO pins used to access a flash memory chip. These pins are generally never used for IO purposes. Some of the current ESP modules don't even bring out the pins anymore. (ESP-12S for example)

What messes you up is stuff like this.

Image

The pins on the board have been relabeled so that the available pins are sequential and there are no holes. This adds to confusion because now we need to know what board you are using rather than just using the ESP8266 pin designations.

Because the original poster stated he was using the ESP12E then that is the designation I used for the pins. If he would have said he was using a nodemcu board then I might have used the relabeled pins but probably not. I would likely have stated I was using the ESP8266 pin numbers.
User avatar
By rudy
#58730
Lxx33 wrote:When I put u8g.begin(0,2); I get an error


Code: Select allvoid draw(void) {
  u8g.begin(0,2); // Here I put it, but don't know if this is the right place.
  // graphic commands to redraw the complete screen should be placed here 
  u8g.setFont(u8g_font_unifont);
  //u8g.setFont(u8g_font_osb21);
  u8g.drawStr( 0, 22, "Hello World!");
}

void setup(void) {


The error show
Code: Select allno matching function for call to 'U8GLIB_SSD1306_128X64::begin(int, int)'
     u8g.begin(0,2);


I really appreciate you all helping me :) :mrgreen: :mrgreen:


I am not certain (I have not read the whole issue) but it seems that the library does not use generic Arduino I2C functions. That the programmer rolled their own or used something else. Have a look at the issue on ESP8266 support for that library.

https://github.com/olikraus/u8glib/issues/333
User avatar
By rudy
#58731
rudy wrote:
Lxx33 wrote:When I put u8g.begin(0,2); I get an error


Code: Select allvoid draw(void) {
  u8g.begin(0,2); // Here I put it, but don't know if this is the right place.
  // graphic commands to redraw the complete screen should be placed here 
  u8g.setFont(u8g_font_unifont);
  //u8g.setFont(u8g_font_osb21);
  u8g.drawStr( 0, 22, "Hello World!");
}

void setup(void) {


The error show
Code: Select allno matching function for call to 'U8GLIB_SSD1306_128X64::begin(int, int)'
     u8g.begin(0,2);


I really appreciate you all helping me :) :mrgreen: :mrgreen:


I am not certain (I have not read the whole issue) but it seems that the library does not use generic Arduino I2C functions. That the programmer rolled their own or used something else. (don't quote me on this) Have a look at the issue on ESP8266 support for that library.

https://github.com/olikraus/u8glib/issues/333
User avatar
By edwin
#58763 Rudy, thanks. Well, yes and no. It isnt the relabelling that confuses me as i thought i had that covered, but the fact someone says he is using D0 and D2 and then declares Wire.begin(0,2) rather than Wire.begin(D0,D2) because as far as I know the compiler doesnt interpret that the same, regardless which ESPboard is used.

It is not about the extra pins of the flash memory, that is a complete seperate issue.

Anyway, this was just a side issue and not the question at hand