Newhaven Dispaly - Getting desperate!

Hi,

I hope you will all forgive me for my impudence?

Rather than repeat all the information again, I wonder if you could scan this thread for me. And hopefully the linked log files. NHD-0216AW-IB3 with Arduino Uno Code example? in the hope that you can point me in the right direction.

It may be quicker to start at the bottom and craw up?

Best regards, Martin

It is rather impudent.

You have not even bothered to tell us what the Thread is about or why you are interested in it, or what exactly you want help with.

It may surprise you to know that I am even lazier than you are.

...R

Post your code HERE.
Post links to non-standard libraries HERE.
Post error messages HERE.

It appears, though, as though you have linker issues, not compiler issues. This suggests to me that you have the header file for a class, but not the source code that goes with it.

PaulS:
Post your code HERE.
Post links to non-standard libraries HERE.
Post error messages HERE.

Thank you Paul for the tips. I'd love to post code, if it would help. It is only the stuff I was trying to avoid repeating...

Posting Code HERE. This is oled-example.ino (provided by ChrisO of Newhaven Display Team)

// library by Phil Grant 2013 www.gadjet.co.uk
// OLedI2C library http://gadjetsblog.blogspot.com/2013/09/oled-1602-display-and-library-for.html

// I2C Wire Library Newhaven Display NHD-0420CW OLED TEST

// Wire Library, This library allows you to communicate with I2C / TWI devices
// Board           I2C / TWI pins
// Uno, Ethernet   A4 (SDA), A5 (SCL)
// Mega2560        20 (SDA), 21 (SCL)
// Leonardo         2 (SDA),  3 (SCL)
// Due             20 (SDA), 21 (SCL), SDA1, SCL1
//Teensy 3.0/3.1   18 (SDA), 19 (SCL),Back Side 30 (SDA1), 29 (SCL1)

#include <Wire.h>

#define I2C_ADDR 0x3c  // Define I2C Address, 0x3c or 0x3d
#include <OLedI2C.h>
OLedI2C LCD;

// custom font arrays
byte newChar1[8] = {
  B11011,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B10101
};

byte newChar2[8] = {
  B10000,
  B01000,
  B00101,
  B00100,
  B00100,
  B00101,
  B01000,
  B10000
};

byte newChar3[8] = {
  B10001,
  B01010,
  B01110,
  B00100,
  B00100,
  B01110,
  B01010,
  B10001
};

byte newChar4[8] = {
  B11111,
  B11111,
  B11111,
  B00100,
  B00100,
  B11111,
  B11111,
  B11111
};

byte newChar5[8] = { // 5TH custom font
  B10101,
  B10000,
  B10110,
  B00001,
  B00000,
  B10001,
  B01010,
  B00000
};

void setup() {
  Wire.begin(); // Start Wire Library
  LCD.init(I2C_ADDR); // initialize the lcd with I2C Address
  //delay(1000);
  // Store custom font data in 420CW Oled
  LCD.createChar(0, newChar1);
  LCD.createChar(1, newChar2);
  LCD.createChar(2, newChar3);
  LCD.createChar(3, newChar4);
  LCD.createChar(4, newChar5);
  LCD.createChar(5, newChar5);
  LCD.createChar(6, newChar5);
  LCD.createChar(7, newChar5);


  LCD.sendString("SETUP ()", 0, 0);    //("String", col, row)
  delay(1000);
}

void loop() {
  //////////// set Contrast test 1 ////////////////
  LCD.sendString("set Contrast test DW", 0, 0);    //("String", col, row)
  for (int Contrast = 255; Contrast > 0; Contrast = Contrast-- / 2 ) {
    LCD.setContrast(Contrast); // Set Contrast (Minimum allowed 0) 0~255
    LCD.setCursor(9, 1); //(col,row)
    LCD.print(Contrast);
    LCD.print("    "); //clear
    delay(300); //delay not necessary as its sending a lot of Commands wich has delay inside the lib.

  }
  delay(2000); // 2sec. delay

  LCD.clearLcd();
  LCD.sendString("set Contrast test UP", 0, 0);    //("String", col, row)
  for (int Contrast = 0; Contrast < 510; Contrast = Contrast++ * 2 ) {
    LCD.setContrast(Contrast); // Set Contrast (Minimum allowed 0) 0~255
    LCD.cursPos(9, 1); //(col,row)
    LCD.print(Contrast);
    LCD.print("    "); //clear
    delay(300); //delay not necessary as its sending a lot of Commands wich has delay inside the lib.
  }
  delay(2000); // 2sec. delay
  LCD.clearLcd();

  // Double Height(4-line) Test
  LCD.sendString("Double Height(4x20)", 0, 0);
  LCD.sendString("Test", 8, 1);
  delay(2000); // 2sec. delay
  LCD.setDoubleH(1);
  LCD.sendString("MODE 1", 0, 2);
  delay(1000); // 1sec. delay
  LCD.setDoubleH(2);
  LCD.sendString("MODE 2", 0, 2);
  delay(1000); // 1sec. delay
  LCD.setDoubleH(3);
  LCD.sendString("MODE 3", 0, 1);
  delay(1000); // 1sec. delay
  LCD.sendString("      ", 0, 1); // clear MODE 3 from Oled

  LCD.setDoubleH(4);
  LCD.sendString("MODE 4", 0, 2);
  delay(1000); // 1sec. delay
  LCD.setDoubleH(0); //back to 4x20
  LCD.sendString("MODE 0 (4-line)", 0, 2);
  delay(3000); // 3sec. delay
  LCD.clearLcd();

  //////////// Print custom font Using Wire.h Library test 2 ////////////////
  LCD.setDoubleH(3); // MODE 1
  LCD.sendString("Print custom font / Wire Library", 0, 0);    //("String", col, row)
  LCD.sendString("custom font -->", 0, 3);
  delay(3000); // 1sec. delay
  LCD.setDoubleH(0);
  delay(1000); // 1sec. delay
  LCD.cursPos(16, 3); //(col,row) / set up position
  // Test  / Print custom font 5 using Wire.h Library
  Wire.beginTransmission(I2C_ADDR); // start condition + Define I2C Address where the US2066 is, and set  R/W# bit to logic “0” write mode.
  // Print custom font
  Wire.write(B01000000); // control byte or the data byte, Co and D/C# bits following by six “0”’s.
  //Wire.write(B00000011); //DEC 3 // print custom font 4  [8bit (hi bit 0000/low bit 0011
  Wire.write(4); //DEC 4 / 5th custom font (Zero based array indexing.....)
  Wire.endTransmission(); // stop condition / 7) The write mode will be finished when a stop condition is applied.
  delay(3000); // 3sec. delay
  LCD.clearLcd();
  delay(1000); //1sec. delay

  //////////// Print 2 custom font Using LCD.sendData test 3 ////////////////
  LCD.sendString(" Print two custom   fonts / LCD.sendData", 0, 0);    //("String", col, row)
  LCD.cursPos(2, 2); //(col,row)
  LCD.print("---> ");
  delay(1000); // 1sec. delay
  LCD.sendData(0); //Print custom font 1 (Zero based array indexing.....)
  LCD.print(" <---> ");
  delay(1000); // 1sec. delay
  LCD.sendData(char(1)); //Print custom font 2
  delay(3000); // 3sec. delay
  LCD.clearLcd();
  delay(1000);

  //LCD.scrollString("test", 2, 100);

  //////////// command test ////////////////
  /*
    sendCommand(0x2A);//function set (extended command set)
    sendCommand(0x71); //function selection A
    sendData(0x00);    //disable internal VDD regulator (2.8V I/O). data(0x5C) = enable regulator (5V I/O)
    sendCommand(0x28); //function set (fundamental sendCommand set)
    sendCommand(0x08); //display off, cursor off, blink off
    sendCommand(0x2A); //function set (extended command set)
    sendCommand(0x79); //OLED command set enabled
    sendCommand(0xD5); //set display clock divide ratio/oscillator frequency
    sendCommand(0x70); //set display clock divide ratio/oscillator frequency
    sendCommand(0x78); //OLED command set disabled
    sendCommand(0x09); //extended function set (4-lines) / last bit=1 : 3-line or 4-line display mode
    sendCommand(0x06); //COM SEG direction
    sendCommand(0x72); //function selection B
    sendData(B00000000);   //ROM CGRAM selection
    sendCommand(0x2A); //function set (extended command set)
    sendCommand(0x79); //OLED command set enabled
    sendCommand(0xDA); //set SEG pins hardware configuration
    sendCommand(0x10); //set SEG pins hardware configuration
    sendCommand(0xDC); //function selection C
    sendCommand(0x00); //function selection C
    sendCommand(0x81); //set contrast control
    sendCommand(0x7F); //set contrast control
    sendCommand(0xD9); //set phase length
    sendCommand(0xF1); //set phase length
    sendCommand(0xDB); //set VCOMH deselect level
    sendCommand(0x40); //set VCOMH deselect level
    sendCommand(0x78); //OLED command set disabled
    sendCommand(0x28); //function set (fundamental command set)
    sendCommand(0x01); //clear display
    sendCommand(0x80); //set DDRAM address to 0x00
    sendCommand(0x0C); //display ON

    delay(150);
    sendCommand(0x0C);  	// **** Turn on Display
    delay(150);*/
}

And this is the link to Non-Standard Libraries: http://www.mpr75.talktalk.net/

I'm sure you don't realty mean that I should post the verbose log HERE? - it's 30kb!
I have posted it at the link above.

PaulS:
It appears, though, as though you have linker issues, not compiler issues. This suggests to me that you have the header file for a class, but not the source code that goes with it.

The Library that I was given by Newhaven Displays has two files: OLedI2C.ccp & OLedI2C.h. I guess that the .h is the class header & the .ccp is the class source code that goes with it? Do I need more?

Best regards, Martin

The Library that I was given by Newhaven Displays has two files: OLedI2C.ccp & OLedI2C.h.

Where have you installed the files ?

Hi UKHeliBob,

These are the points (copied from my Newhaven Thread) that look at this possibility:

Hi Chris, [...] Looking at the "Library in the wrong location" first.
While yes, it could be. But this is the results of this line of inquiry....

  1. I have three library locations (don't know why?), they are:
    a) /home/mprowe/Arduino/libraries/
    b) /home/mprowe/.arduino15/packages/arduino/hardware/avr/1.6.18/libraries/
    c) /opt/arduino-1.8.0/libraries/

  2. For testing purposes only, I have put your library in all three locations - with a customized library.properties file (so that I can get the libraries location from within the Arduino IDE).

  3. The log output (below) shows that it has found all three & is using the copy at (2.b) see lines 86 to 89. This is alongside the wire library.

74 Linking everything together...
75 "/home/mprowe/.arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" [.... truncated by me]
76 /tmp/ccVbwl16.ltrans0.ltrans.o: In function `__static_initialization_and_destruction_0':
77 /home/mprowe/Arduino/nhd-i2c/oled-example/oled-example.ino:16: undefined reference to `OLedI2C::OLedI2C()'
78 /tmp/ccVbwl16.ltrans0.ltrans.o: In function `setup':
79 /home/mprowe/Arduino/nhd-i2c/oled-example/oled-example.ino:24: undefined reference to `OLedI2C::init(unsigned char)'
80 /tmp/ccVbwl16.ltrans0.ltrans.o: In function `loop':
81 /home/mprowe/Arduino/nhd-i2c/oled-example/oled-example.ino:29: undefined reference to `OLedI2C::sendString(char const*, unsigned char, unsigned char)'
82 /home/mprowe/Arduino/nhd-i2c/oled-example/oled-example.ino:30: undefined reference to `OLedI2C::sendFloat(float, unsigned char, unsigned char, unsigned char, unsigned char)'
83 /tmp/ccVbwl16.ltrans0.ltrans.o: In function `_GLOBAL__sub_D_LCD':
84 /home/mprowe/Arduino/nhd-i2c/oled-example/oled-example.ino:16: undefined reference to `OLedI2C::~OLedI2C()'
85 collect2: error: ld returned 1 exit status
86 Multiple libraries were found for "OLedI2C.h"
87  Used: /home/mprowe/.arduino15/packages/arduino/hardware/avr/1.6.18/libraries/OLedI2C
88  Not used: /home/mprowe/Arduino/libraries/OLedI2C.home
89  Not used: /opt/arduino-1.8.0/libraries/OLedI2C.opt
90 Using library Wire    at version 1.0 in folder: /home/mprowe/.arduino15/packages/arduino/hardware/avr/1.6.18/libraries/Wire
91 Using library OLedI2C at version 1.0 in folder: /home/mprowe/.arduino15/packages/arduino/hardware/avr/1.6.18/libraries/OLedI2C
92 exit status 1
93 Error compiling for board Arduino/Genuino Uno.
  1. Compiling with only one copy of the OLedI2C in each location. First run with OLedI2C in 2.a), second run with OLedI2C in 2.b) and finally with OLedI2C in location 2.c). This still results in a compilation error?

  2. To try and avoid any OS dependency’s (NHD are using Windows, & I use Linux), I have done the same using the official web based workbench, Arduino Create. Yet again, no compilation success!! I have posted the verbose error log here http://www.mpr75.talktalk.net/. At my (low-level) of understanding, the output logs from all three OS'ies (Linux, Windows & web based) seem similar. To me, it is suggesting a path-resolution problem in OLedI2C.ccp or its dependencies?

And this is the link to Non-Standard Libraries: http://www.mpr75.talktalk.net/

That does not appear to link to the library. There appear to be only log files at that address.

Third party libraries are usually installed in the libraries folder of your sketch directory and #included in your program using < and > round the full name of the header file.

Without your program code and libraries it is difficult to offer advice and impossible to try to compile the code.

  1. I have three library locations (don't know why?), they are:
    a) /home/mprowe/Arduino/libraries/
    b) /home/mprowe/.arduino15/packages/arduino/hardware/avr/1.6.18/libraries/
    c) /opt/arduino-1.8.0/libraries/

Only a is correct. Delete the other two copies COMPLETELY.

Hi PaulS,

Only a is correct.

Yes, I understand that is the correct configuration. I did say it was "For testing only". I also went on to say that even with a single copy in location a), it would not compile!

That does not appear to link to the library.

Opps.... Sorry. They are there now. I have also uploaded oled-test.ino.
It would be great if your intention was to try compiling at your end.

Regards, Martin