Help with Arduino Header file confusion

Hi,

Trying to make the following program compile.

I2C LCD 2004 to a backpack 8574T (Not the 'A' version) to a MEGA2560 (range pip)

when I compile, Arduino reports header file errors?

"error: no matching function for call to 'TwoWire::begin(int&, int&)'"

which .h files do i need for the above to compile and where should I save them?

Currently Arduino looks in nightly arduino folder ??

Thanks for any ideas
Steve

Here is the test code:

#include <LiquidCrystal.h>
#include <twi.h>
#include <Wire.h>
#include <jm_PCF8574.h>
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////

#define PROG "jm_PCF8574_blink"

////////////////////////////////////////////////////////////////////////////////

/* This example blinks the backlight of a LCM2004A I2C LCD module.
The LCM2004A module is commonly interfaced for I2C with a PCF8574A,
optionaly with a pcf8574.

*/

#define LCM2004A_I2C_ADR1 ((uint8_t) 0x3F) // default PCF8574A I2C address
#define LCM2004A_I2C_ADR2 ((uint8_t) 0x27) // alternative PCF8574 I2C address

#define LCM2004A_I2C_DB ((uint8_t) 0b11110000) // P7-P4: Four high order data bus pins
#define LCM2004A_I2C_DB7 ((uint8_t) 0b10000000) // P7
#define LCM2004A_I2C_DB6 ((uint8_t) 0b01000000) // P6
#define LCM2004A_I2C_DB5 ((uint8_t) 0b00100000) // P5
#define LCM2004A_I2C_DB4 ((uint8_t) 0b00010000) // P4
#define LCM2004A_I2C_BL ((uint8_t) 0b00001000) // P3: LCD backlight
#define LCM2004A_I2C_E ((uint8_t) 0b00000100) // P2: Starts data read/write
#define LCM2004A_I2C_R_W ((uint8_t) 0b00000010) // P1: Selects Read/Write (1/0)
#define LCM2004A_I2C_RS ((uint8_t) 0b00000001) // P0: Selects Instruction/Data register (0/1)

#define LCM2004A_I2C_BL_PIN ((uint8_t) 3) // P3: LCD backlight pin number

jm_PCF8574 pcf8574; // I2C address fixed later by begin(...)

////////////////////////////////////////////////////////////////////////////////

#ifndef LED_BUILTIN
#define LED_BUILTIN (25) // TTGO-LoRa V2.1.6
#endif

////////////////////////////////////////////////////////////////////////////////

void setup()
{
Serial.begin(115200);
while (!Serial && millis()<3000); // wait for USB Serial ready
Serial.print(F(PROG));
Serial.print(F("..."));
Serial.println();
Serial.flush();

Wire.begin(2,3);

if (!pcf8574.begin(LCM2004A_I2C_ADR1)) pcf8574.begin(LCM2004A_I2C_ADR2);

pinMode( LED_BUILTIN, OUTPUT );
digitalWrite( LED_BUILTIN, LOW );

pcf8574.pinMode( LCM2004A_I2C_BL_PIN, OUTPUT );
pcf8574.digitalWrite( LCM2004A_I2C_BL_PIN, LOW );

}

void loop()
{
digitalWrite( LED_BUILTIN, HIGH );
pcf8574.digitalWrite( LCM2004A_I2C_BL_PIN, HIGH );
delay(500);

digitalWrite( LED_BUILTIN, LOW );
pcf8574.digitalWrite( LCM2004A_I2C_BL_PIN, LOW );
delay(500);

}

You cannot specify the I2C pins on a Mega. The I2C pins are pins 20 and 21 or the I2C pins by the Aref pin.

You do not need (nor want) the twi or the jm_PCF8574 libraries if you use the LiquidCrystal_I2C library.

I would recommend that you use none of those libraries except the Wire library and the hd44780 library.

For an I2C LCD display to work, the I2C address and the I2C backpack to LCD pin mapping must be correct. If the library default settings for either or both are not correct the LCD will not work. You can try to figure out the right pin mapping and use an I2C scanner to find the address, but if you install and use the hd44780 library that is done automatically by the library.

To install the hd44780 library. The hd44780 library is the best available for I2C LCDs. The library is available in the Library Manager. Go to Library Manager (in the IDE menus, Sketch, Include Libraries, Manage Libraries) and in the Topics dropdown choose Display and in the Filter your search box enter hd44780. Select and install the hd44780 library by Bill Perry.

The class that you want to use is the hd44780_I2Cexp class. There are examples to show how to use the library. The nice thing about the hd44780 library is that it will autodetect the I2C address and the I2C backpack to LCD pin mapping.

In the examples, there is a diagnostic sketch that will help us to help you if you still have trouble with the display. Run the diagnostic sketch and post the results.

Read the forum guidelines to see how to properly post code and some good information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

You can go back and fix your original post by highlighting the code and clicking the </> in the menu bar.
code tags new

Thanks

Installed the hd44780 by Bill Perry

where is the example sketch?

Thanks
Steve

Here is the path to the examples for I2C backpack equipped LCD displays.

Here is an example sketch that blinks the backlight on 1/2 second and off 1/2 second.

// hd44780 simple "Hello World" by c gounding AKA groundFungus
// hd44780 library see https://github.com/duinoWitchery/hd44780

#include <Wire.h>
#include <hd44780.h>                       // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header

hd44780_I2Cexp lcd; // declare lcd object: auto locate & auto config expander chip

// LCD geometry
const int LCD_COLS = 20;
const int LCD_ROWS = 4;

void setup()
{
   lcd.begin(LCD_COLS, LCD_ROWS);
   lcd.clear();
   lcd.print("Hello World");   
}

void loop()
{
   lcd.noBacklight();
   delay(500);
   lcd.backlight();
   delay(500);
}

I pointed to the wrong directory in the previous post. I will fix it an undelete it as fast as I can.

I fixed the path to the I2Cexp examples. Use the path in post #4.

Thanks,

Tried the tocompile the skectch you posted above.

run out of time this end , will try again tomorrow, thanks for your help

FYI
when compiling above sketch lots of problems with header file location

es\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:34:2: error: #error Wire library is not supported on this board
#error Wire library is not supported on this board?? esp32??

and

C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:315:6: error: prototype for 'void TwoWire::onReceive(void (*)(size_t))' does not match any in class 'TwoWire'
void TwoWire::onReceive(void (*function)(size_t))

maybe Arduino is installing the header files in the wrong place?
also keeps looking for TwoWire.CPP??

Thanks will try again tomorrow morning

As noted, I had the wrong directory for the examples, but corrected that mistake. Use the directory in the corrected post. Apologies for any inconvenience.

Did you install the hd44780 library using the IDE library manager?

Did you try my blink the backlight example or any of the library examples?

ESP32????? In your first post you say Mega2560. WTF?

What board are you using? How is the LCD connected to the mystery board?

Hi,

I'm using a I2C LCD 2004 not the hd44780 (are they the same thing?)
back plate 8574T
And the Arduino Mega range pip

is their an example sketch that works with this setup above?

also where do the header files have to saved to.

Hello world sketch responds with

avrdude: jtagmkII_getsync(): sign-on command: status -1 (keeps re-trying)

Thanks

from examples LCD display / blink

compiled ok
and appears to have downloaded into the MEGA

screen is illuminated but not blinking?

Cheers

below is the download feedback.

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: reading input file "C:\Users\STEVE_~1\AppData\Local\Temp\arduino_build_647315/Blink.ino.hex"
avrdude: writing flash (2508 bytes):

Writing | ################################################## | 100% 0.41s

avrdude: 2508 bytes of flash written
avrdude: verifying flash memory against C:\Users\STEVE_~1\AppData\Local\Temp\arduino_build_647315/Blink.ino.hex:
avrdude: load data flash data from input file C:\Users\STEVE_~1\AppData\Local\Temp\arduino_build_647315/Blink.ino.hex:
avrdude: input file C:\Users\STEVE_~1\AppData\Local\Temp\arduino_build_647315/Blink.ino.hex contains 2508 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.33s

avrdude: verifying ...
avrdude: 2508 bytes of flash verified

avrdude done. Thank you.

The hd44780 is the controller chip on the LCD. The hd44780 library is made to work with the PCF8574 I2C expander backpack and the hd44780 LCD controller.

What does range pip mean. Do you have a Mega2560 board? To what Mega pins are the LCD pins connected? Photos of the board with the LCD attached showing the wiring would be a big help.

I don't know what that means. The header files are part of the library and are in the library installation. Did you install the hd44780 library using the IDE library manager as described in post #2?

I just tried the example that I posted in post #4 and "Hello World" is displayed on the top row and the backlight turns on and off at a 1/2 second rate. If your LCD is not doing that then something is wrong. Please post a schematic of how the LCD should be connected and the requested photos showing the wiring.

The next step is to run the diagnostic program (I2CexpDiag) and post the results shown in the serial monitor.

Ah, I see. range pip is the brand. I had never heard of that brand before.

I await the output from the diagnostic.

MEGA 2560 is accepting code and onboard led is blinking, using example sketch

problem now is just wire.h

yes installed the prescribed way using arduino IDE Library manager

IDE appears to also using 'nightly folder' and confused with twowire.cpp

maybe the IDE needs to be deleted and re installed?

tried to compile I2CexpDiag - same problem with header files, arduino IDE

C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:307:6: error: candidate is: void TwoWire::onReceive(void (*)(int))
void TwoWire::onReceive(void (*function)(int))
^~~~~~~

Error while detecting libraries included by C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp

Arduino IDE not happy with header file wire.h or equiv

C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:34:2: error: #error Wire library is not supported on this board
#error Wire library is not supported on this board
^~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:39:27: error: 'I2C_BUFFER_LENGTH' was not declared in this scope
uint8_t TwoWire::rxBuffer[I2C_BUFFER_LENGTH];
^~~~~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:39:27: note: suggested alternative: 'TWI_BUFFER_LENGTH'
uint8_t TwoWire::rxBuffer[I2C_BUFFER_LENGTH];
^~~~~~~~~~~~~~~~~
TWI_BUFFER_LENGTH
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:40:18: error: conflicting declaration 'size_t TwoWire::rxBufferIndex'
size_t TwoWire::rxBufferIndex = 0;
^~~~~~~~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:38:20: note: previous declaration as 'uint8_t TwoWire::rxBufferIndex'
static uint8_t rxBufferIndex;
^~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:40:18: warning: declaration of 'uint8_t TwoWire::rxBufferIndex' outside of class is not definition [-fpermissive]
size_t TwoWire::rxBufferIndex = 0;
^~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:41:18: error: conflicting declaration 'size_t TwoWire::rxBufferLength'
size_t TwoWire::rxBufferLength = 0;
^~~~~~~~~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:39:20: note: previous declaration as 'uint8_t TwoWire::rxBufferLength'
static uint8_t rxBufferLength;
^~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:41:18: warning: declaration of 'uint8_t TwoWire::rxBufferLength' outside of class is not definition [-fpermissive]
size_t TwoWire::rxBufferLength = 0;
^~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:44:27: error: 'I2C_BUFFER_LENGTH' was not declared in this scope
uint8_t TwoWire::txBuffer[I2C_BUFFER_LENGTH];
^~~~~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:44:27: note: suggested alternative: 'TWI_BUFFER_LENGTH'
uint8_t TwoWire::txBuffer[I2C_BUFFER_LENGTH];
^~~~~~~~~~~~~~~~~
TWI_BUFFER_LENGTH
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:45:18: error: conflicting declaration 'size_t TwoWire::txBufferIndex'
size_t TwoWire::txBufferIndex = 0;
^~~~~~~~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:43:20: note: previous declaration as 'uint8_t TwoWire::txBufferIndex'
static uint8_t txBufferIndex;
^~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:45:18: warning: declaration of 'uint8_t TwoWire::txBufferIndex' outside of class is not definition [-fpermissive]
size_t TwoWire::txBufferIndex = 0;
^~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:46:18: error: conflicting declaration 'size_t TwoWire::txBufferLength'
size_t TwoWire::txBufferLength = 0;
^~~~~~~~~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:44:20: note: previous declaration as 'uint8_t TwoWire::txBufferLength'
static uint8_t txBufferLength;
^~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:46:18: warning: declaration of 'uint8_t TwoWire::txBufferLength' outside of class is not definition [-fpermissive]
size_t TwoWire::txBufferLength = 0;
^~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:50:39: error: conflicting declaration 'void (* TwoWire::user_onReceive)(size_t)'
void (TwoWire::user_onReceive)(size_t);
^
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:48:19: note: previous declaration as 'void (
TwoWire::user_onReceive)(int)'
static void (user_onReceive)(int);
^~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:50:39: warning: declaration of 'void (
TwoWire::user_onReceive)(int)' outside of class is not definition [-fpermissive]
void (TwoWire::user_onReceive)(size_t);
^
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:52:30: error: 'SDA' was not declared in this scope
static int default_sda_pin = SDA;
^~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:52:30: note: suggested alternative: 'SPDR'
static int default_sda_pin = SDA;
^~~
SPDR
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:53:30: error: 'SCL' was not declared in this scope
static int default_scl_pin = SCL;
^~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:53:30: note: suggested alternative: 'SPL'
static int default_scl_pin = SCL;
^~~
SPL
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:61:6: error: prototype for 'void TwoWire::begin(int, int)' does not match any in class 'TwoWire'
void TwoWire::begin(int sda, int scl)
^~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:55:10: error: candidates are: void TwoWire::begin(int)
void begin(int);
^~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:54:10: error: void TwoWire::begin(uint8_t)
void begin(uint8_t);
^~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:53:10: error: void TwoWire::begin()
void begin();
^~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:69:6: error: prototype for 'void TwoWire::begin(int, int, uint8_t)' does not match any in class 'TwoWire'
void TwoWire::begin(int sda, int scl, uint8_t address)
^~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:55:10: error: candidates are: void TwoWire::begin(int)
void begin(int);
^~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:54:10: error: void TwoWire::begin(uint8_t)
void begin(uint8_t);
^~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:53:10: error: void TwoWire::begin()
void begin();
^~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:80:36: error: no 'void TwoWire::pins(int, int)' member function declared in class 'TwoWire'
void TwoWire::pins(int sda, int scl)
^
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'void TwoWire::begin()':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:88:43: error: no matching function for call to 'TwoWire::begin(int&, int&)'
begin(default_sda_pin, default_scl_pin);
^
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:86:6: note: candidate: void TwoWire::begin()
void TwoWire::begin(void)
^~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:86:6: note: candidate expects 0 arguments, 2 provided
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:54:10: note: candidate: void TwoWire::begin(uint8_t)
void begin(uint8_t);
^~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:54:10: note: candidate expects 1 argument, 2 provided
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:55:10: note: candidate: void TwoWire::begin(int)
void begin(int);
^~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:55:10: note: candidate expects 1 argument, 2 provided
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: At global scope:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:99:25: error: no 'uint8_t TwoWire::status()' member function declared in class 'TwoWire'
uint8_t TwoWire::status()
^
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'void TwoWire::setClock(uint32_t)':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:111:5: error: 'twi_setClock' was not declared in this scope
twi_setClock(frequency);
^~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:111:5: note: suggested alternative: 'setClock'
twi_setClock(frequency);
^~~~~~~~~~~~
setClock
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: At global scope:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:114:50: error: no 'void TwoWire::setClockStretchLimit(uint32_t)' member function declared in class 'TwoWire'
void TwoWire::setClockStretchLimit(uint32_t limit)
^
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:119:8: error: prototype for 'size_t TwoWire::requestFrom(uint8_t, size_t, bool)' does not match any in class 'TwoWire'
size_t TwoWire::requestFrom(uint8_t address, size_t size, bool sendStop)
^~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:69:13: error: candidates are: uint8_t TwoWire::requestFrom(int, int, int)
uint8_t requestFrom(int, int, int);
^~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:68:13: error: uint8_t TwoWire::requestFrom(int, int)
uint8_t requestFrom(int, int);
^~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:67:13: error: uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t)
uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t);
^~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:66:13: error: uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)
uint8_t requestFrom(uint8_t, uint8_t, uint8_t);
^~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:65:13: error: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)
uint8_t requestFrom(uint8_t, uint8_t);
^~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:133:91: error: call of overloaded 'requestFrom(uint8_t&, size_t, bool)' is ambiguous
return requestFrom(address, static_cast<size_t>(quantity), static_cast(sendStop));
^
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:131:9: note: candidate: uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)
uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop)
^~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:69:13: note: candidate: uint8_t TwoWire::requestFrom(int, int, int)
uint8_t requestFrom(int, int, int);
^~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:138:68: error: call of overloaded 'requestFrom(uint8_t&, size_t, bool)' is ambiguous
return requestFrom(address, static_cast<size_t>(quantity), true);
^
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:131:9: note: candidate: uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)
uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop)
^~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:69:13: note: candidate: uint8_t TwoWire::requestFrom(int, int, int)
uint8_t requestFrom(int, int, int);
^~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'uint8_t TwoWire::requestFrom(int, int)':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:143:90: error: call of overloaded 'requestFrom(uint8_t, size_t, bool)' is ambiguous
return requestFrom(static_cast<uint8_t>(address), static_cast<size_t>(quantity), true);
^
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:131:9: note: candidate: uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)
uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop)
^~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:69:13: note: candidate: uint8_t TwoWire::requestFrom(int, int, int)
uint8_t requestFrom(int, int, int);
^~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'uint8_t TwoWire::requestFrom(int, int, int)':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:149:51: error: call of overloaded 'requestFrom(uint8_t, size_t, bool)' is ambiguous
static_cast(sendStop));
^
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:131:9: note: candidate: uint8_t TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)
uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop)
^~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:146:9: note: candidate: uint8_t TwoWire::requestFrom(int, int, int)
uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop)
^~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'uint8_t TwoWire::endTransmission(uint8_t)':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:167:79: error: too few arguments to function 'uint8_t twi_writeTo(uint8_t, uint8_t
, uint8_t, uint8_t, uint8_t)'
int8_t ret = twi_writeTo(txAddress, txBuffer, txBufferLength, sendStop);
^
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:28:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\twi.h:41:11: note: declared here
uint8_t twi_writeTo(uint8_t, uint8_t*, uint8_t, uint8_t, uint8_t);
^~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'virtual size_t TwoWire::write(uint8_t)':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:183:31: error: 'I2C_BUFFER_LENGTH' was not declared in this scope
if (txBufferLength >= I2C_BUFFER_LENGTH)
^~~~~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:183:31: note: suggested alternative: 'TWI_BUFFER_LENGTH'
if (txBufferLength >= I2C_BUFFER_LENGTH)
^~~~~~~~~~~~~~~~~
TWI_BUFFER_LENGTH
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'virtual int TwoWire::available()':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:226:9: error: 'optimistic_yield' was not declared in this scope
optimistic_yield(1000);
^~~~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: At global scope:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:261:6: error: prototype for 'void TwoWire::onReceiveService(uint8_t*, size_t)' does not match any in class 'TwoWire'
void TwoWire::onReceiveService(uint8_t* inBytes, size_t numBytes)
^~~~~~~
In file included from C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:29:0:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\Wire.h:50:17: error: candidate is: static void TwoWire::onReceiveService(uint8_t*, int)
static void onReceiveService(uint8_t*, int);
^~~~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'void TwoWire::onReceive(void ()(int))':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:312:22: warning: invalid conversion from 'void (
)(size_t) {aka void ()(unsigned int)}' to 'void ()(int)' [-fpermissive]
user_onReceive = reinterpret_cast<void ()(size_t)>(function);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: At global scope:
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:315:6: error: prototype for 'void TwoWire::onReceive(void (
)(size_t))' does not match any in class 'TwoWire'
void TwoWire::onReceive(void (function)(size_t))
^~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:307:6: error: candidate is: void TwoWire::onReceive(void (
)(int))
void TwoWire::onReceive(void (function)(int))
^~~~~~~
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp: In member function 'void TwoWire::onRequest(void (
)())':
C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire\src\TwoWire.cpp:324:5: error: 'twi_enableSlaveMode' was not declared in this scope
twi_enableSlaveMode();
^~~~~~~~~~~~~~~~~~~
Multiple libraries were found for "Wire.h"
Used: C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire
Not used: C:\Users\steve_hateley\Documents\Arduino\libraries\jm_PCF8574
Using library Wire at version 1.0 in folder: C:\Program Files\arduino-nightly-windows\arduino-nightly\hardware\arduino\avr\libraries\Wire
Using library hd44780 at version 1.3.2 in folder: C:\Users\steve_hateley\Documents\Arduino\libraries\hd44780
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

Is that the example code from post #4 that flashes the LCD backlight?

What problem? Are you getting an error? And it should be Wire.h, case is important in C++. Wire.h and wire.h are not the same.

Are you using the IDE that is installed on your computer or the on-line IDE. If the on-line IDE I can't be of much help because I do not use it and and not familiar with it at all.

using IDE on a laptop

sorry - IDE not an on line version-

OK, I don't know what is going on. The nightly build part has me suspicious. I know that the code works for me on a Mega2560 as I have tested it with real hardware with no warnings or errors. At this point I think that you probably do need to delete the IDE installation and re-install the IDE. Just install the latest version (not nightly build) from the download page. I do not know what else to try.

See this thread for instructions on doing a clean install.