Coder Social home page Coder Social logo

I can not compile about iteadlib_arduino_nextion HOT 8 OPEN

itead avatar itead commented on August 22, 2024
I can not compile

from iteadlib_arduino_nextion.

Comments (8)

electrokean avatar electrokean commented on August 22, 2024 2

You shouldn't add libraries under your Arduino install folder. Instead try putting the files under My Documents\Arduino\libraries\Nextion
This folder should contain all the Nex_._ files and should have the same name as the main library include file (Nextion.h)

from iteadlib_arduino_nextion.

JanitoRamos avatar JanitoRamos commented on August 22, 2024 1

From this tuturial: https://randomnerdtutorials.com/nextion-display-with-arduino-getting-started/

This library is configured for Arduino MEGA2560 by default. To make it work for Arduino Uno, you need to do the following:

1. Open the ITEADLIB_Arduino_Nextion folder

2. There should be a NexConfig.h file – open that file.

3. Comment line 27, so that it stays as follows:

//#define DEBUG_SERIAL_ENABLE
4. Comment line 32:

//#define dbSerial Serial
5. Change line 37, so that you have the following:

#define nexSerial Serial
6. Save the NexConfig.h file.

from iteadlib_arduino_nextion.

bigredsmokehouse avatar bigredsmokehouse commented on August 22, 2024

I am having a similar problem. I have my "netxtion" folder in my library folder. (i.e. where the rest of the libraries are). I really like this ease of use with this implementation and would like to use it. My project is quite simple using 2 temperature probes, recipes and a servo motor to control a damper.

I am getting the following errors and wanted to know what in the H I am doing wrong. I simply want to get this to compile. I only tried to compile the CompPage.ino file.

/home/arnold/Arduino/libraries/Nextion/NexHardware.cpp:18:25: error: conflicting declaration ‘SoftwareSerial Serial2’
SoftwareSerial nexSerial(10, 11); // RX, TX
^
In file included from /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h:193:0,
from /home/arnold/Arduino/libraries/Nextion/NexHardware.h:17,
from /home/arnold/Arduino/libraries/Nextion/NexHardware.cpp:15:
/usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.h:107:25: error: ‘Serial2’ has a previous declaration as ‘HardwareSerial Serial2’
extern HardwareSerial Serial2;
^
/home/arnold/Arduino/libraries/Nextion/NexHardware.cpp: In function ‘bool recvRetNumber(uint32_t*, uint32_t)’:
/home/arnold/Arduino/libraries/Nextion/NexHardware.cpp:70:31: warning: left shift count >= width of type [enabled by default]
*number = (temp[4] << 24) | (temp[3] << 16) | (temp[2] << 8) | (temp[1]);
^
/home/arnold/Arduino/libraries/Nextion/NexHardware.cpp:70:49: warning: left shift count >= width of type [enabled by default]
*number = (temp[4] << 24) | (temp[3] << 16) | (temp[2] << 8) | (temp[1]);
^

from iteadlib_arduino_nextion.

maxim25111 avatar maxim25111 commented on August 22, 2024

You are trying to use define SoftwareSerial 2 tmes.
looks like nexSerial have already called SoftwareSerial as HardwareSerial included in file NexSerial.
They are conflicting together trying doing this same.
To understand why is error, open file nextHardware.h and NextHardware.cpp and search for HardwareSerial and Serial2. If there is included that names, it means that You dont need use it again in mine file.
Or doing it arround, coment line where is Serial2 in that files HardwareSerial*

from iteadlib_arduino_nextion.

baugusto avatar baugusto commented on August 22, 2024

UNO-like Mainboards
If your board has only one hardware serial, such as UNO, you should disable dbSerial and redirect nexSerial to Serial(Refer to section:Serial configuration).

Open NexConfig.h and replace line 37 for this: #define nexSerial Serial
and comment line 32, disabling dbSerial.

Then, recompile your code.

from iteadlib_arduino_nextion.

zhekaus avatar zhekaus commented on August 22, 2024

That's weird to fix the library in order to make it work. I have different boards - Mega, UNO, etc.
This is definitely wrong workflow.

from iteadlib_arduino_nextion.

alfonso2ff avatar alfonso2ff commented on August 22, 2024

baugusto and JanitoRamos, thank you. After making corrections to Nexconfig.h the compilation ran without errors. Just a few minor warnings.

from iteadlib_arduino_nextion.

brunohermes avatar brunohermes commented on August 22, 2024

From this tuturial: https://randomnerdtutorials.com/nextion-display-with-arduino-getting-started/

This library is configured for Arduino MEGA2560 by default. To make it work for Arduino Uno, you need to do the following:

1. Open the ITEADLIB_Arduino_Nextion folder

2. There should be a NexConfig.h file – open that file.

3. Comment line 27, so that it stays as follows:

//#define DEBUG_SERIAL_ENABLE 4. Comment line 32:

//#define dbSerial Serial 5. Change line 37, so that you have the following:

#define nexSerial Serial 6. Save the NexConfig.h file.

THANK YOU SO MUCH!

from iteadlib_arduino_nextion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.