lcd

This code works for mega but when I try it on genuine due I get the error message

exit status 1

unable to find numerical literal operator ‘operator"" op0’

/*
** Example Arduino sketch for SainSmart I2C LCD Screen 16x2
** based on Bitbucket
** by
** Edward Comer
** LICENSE: GNU General Public License, version 3 (GPL-3.0)

** This example uses F Malpartida’s NewLiquidCrystal library. Obtain from:
** https://bitbucket.org/fmalpartida/new-liquidcrystal

** Modified - Ian Brennan ianbren at hotmail.com 23-10-2012 to support Tutorial posted to Arduino.cc

** Written for and tested with Arduino 1.0
**
** NOTE: Tested on Arduino Uno whose I2C pins are A4==SDA, A5==SCL

*/
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR 0x3fop0 // <<----- Add your address here. Find it from I2C Scanner
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7

int n = 1;

LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

void setup()
{
lcd.begin (16,2); // <<----- My LCD was 16x2

// Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);
lcd.home (); // go home

lcd.print(" Good Golly");
}

void loop()
{
// Backlight on/off every10 seconds
lcd.setCursor (0,1);
// go to start of 2nd line

lcd.print(" Miss Molly");
lcd.setBacklight(LOW); // Backlight off
delay(3000);
lcd.setBacklight(HIGH); // Backlight on
delay(3000);
}

Please edit your post and embed your code in code tags

``` [code] ``` your code here ``` [/code] ``` so it looks like

 your code here

You can do the same for your complete error message; there is more text in the output window than what you showed.

#define I2C_ADDR    0x3fop0

I doubt that the above is a valid address; as far as I know it should not even compile for a Mega.

Thanks for that Sterretje,I was so tired after trying for hours the code must have got changed.The I2C address is 0x3F it works on myMega programed on my laptop and my sons Uno programed on his laptop but doesn't work on the Due. We both used the I2C address 0x3F after locating it. Please don't spend too much time on this if there isn't a quick fix I will give the Due to my nephew and let it do his head in. Attached is the error message after I ran the original code.

Error

Arduino: 1.6.8 (Windows 7), Board: "Arduino Due (Programming Port)"

Build options changed, rebuilding all In file included from C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:35:0:

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp: In member function 'uint8_t LiquidCrystal_SR1W::clearSR()':

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:77:24: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

SR1W_ATOMIC_WRITE_LOW(srRegister, srMask);

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.h:293:79: note: in definition of macro 'SR1W_ATOMIC_WRITE_LOW'

define SR1W_ATOMIC_WRITE_LOW(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg &= ~mask; }

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:86:22: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

fio_bit reg_val = *srRegister;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:95:5: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_high;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:96:5: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_low;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:101:4: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_high;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp: In member function 'uint8_t LiquidCrystal_SR1W::loadSR(uint8_t)':

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:139:24: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

fio_bit reg_val = *srRegister;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:144:6: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_low;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:145:6: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_high;

^

In file included from C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:35:0:

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:151:26: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

SR1W_ATOMIC_WRITE_LOW(srRegister, srMask);

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.h:293:79: note: in definition of macro 'SR1W_ATOMIC_WRITE_LOW'

define SR1W_ATOMIC_WRITE_LOW(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg &= ~mask; }

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:158:27: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

SR1W_ATOMIC_WRITE_HIGH(srRegister, srMask);

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.h:294:80: note: in definition of macro 'SR1W_ATOMIC_WRITE_HIGH'

define SR1W_ATOMIC_WRITE_HIGH(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg |= mask; }

^

exit status 1 Error compiling for board Arduino Due (Programming Port).

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

Arduino: 1.6.8 (Windows 7), Board: "Arduino Due (Programming Port)"

Build options changed, rebuilding all In file included from C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:35:0:

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp: In member function 'uint8_t LiquidCrystal_SR1W::clearSR()':

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:77:24: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

SR1W_ATOMIC_WRITE_LOW(srRegister, srMask);

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.h:293:79: note: in definition of macro 'SR1W_ATOMIC_WRITE_LOW'

define SR1W_ATOMIC_WRITE_LOW(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg &= ~mask; }

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:86:22: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

fio_bit reg_val = *srRegister;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:95:5: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_high;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:96:5: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_low;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:101:4: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_high;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp: In member function 'uint8_t LiquidCrystal_SR1W::loadSR(uint8_t)':

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:139:24: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

fio_bit reg_val = *srRegister;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:144:6: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_low;

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:145:6: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

*srRegister = bit_high;

^

In file included from C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:35:0:

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:151:26: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

SR1W_ATOMIC_WRITE_LOW(srRegister, srMask);

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.h:293:79: note: in definition of macro 'SR1W_ATOMIC_WRITE_LOW'

define SR1W_ATOMIC_WRITE_LOW(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg &= ~mask; }

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.cpp:158:27: error: invalid type argument of unary '*' (have 'fio_register {aka unsigned char}')

SR1W_ATOMIC_WRITE_HIGH(srRegister, srMask);

^

C:UsersuserDocumentsArduinolibrariesNewliquidCrystalLiquidCrystal_SR1W.h:294:80: note: in definition of macro 'SR1W_ATOMIC_WRITE_HIGH'

define SR1W_ATOMIC_WRITE_HIGH(reg, mask) ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *reg |= mask; }

^

exit status 1 Error compiling for board Arduino Due (Programming Port).

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.