What i want to do is probably not possible (because i couldn't find any document or topic about it) but i want to ask just to be sure
I was working an hobby project for my car to read OBDII data from car and show it on lcd screen, i've completed the project by using, sparkfun OBDII UART + Arduino Mega 2560+ DFRobot Gravity I2C 16x2 RGB LCD, it works without any problem. Couple days ago one of my friend bought me an Nextion 5inch LCD as a gift, i had never use that screen before but i learnt through tutorials and videos and finally make it work with arduino mega 2560's TX - RX pins.
I would like to change my 16x2 rgb lcd with this nextion screen, my problem starts here, when i program the 16x2 lcd i've used I2C library, that's why 16x2 lcd works through SCL-SDA pins right now, my setup already mounted to car (by my mechanic) and my hand skills are so poor to disassemble my car's parts, when mechanic laying cables for my setup he disassembled dashboard, some of the glove compartment, obd port's shield and many other things, so it is beyond my hand skills.
But if i find a way to make it work this screen through SCL - SDA pins, then all i have to do is unplug 16x2 lcd's jack and plug to nextion secreen's socket and change my arduino code accordingly.
Is there any chance to make it work nextion screen through SCl -SDA pins instead of RX-TX pins?
You can’t get the nextion to work on I2C , but maybe you could use A4,A5 with software serial, if you can’t move any cables, so you don’t have to change your wiring - guess you’d need to try that and alter your coding to suit
KASSIMSAMJI:
Good, you can make it work with RX1,TX1 or even RX2,TX2 too
it's just a matter of modifying NexConfig.h file, line that says
#define nexSerial Serial
to
#define nexSerial Serial1
for RX1,TX1 or
#define nexSerial Serial2
for RX2,TX2
and in your main code, you will be referencing it by Serial1/Serial2
yeap i already did that,i can make it work through serial1-2-3 with changing NexConfig.h file, but my problem is on my setup rgb 16x2 lcd is connected to SCL-SDA so cables coming from those pins not from rx-tx, to work with this screen i have to dismount my setup and change cables from scl-sda to RX-TX, to do that i need to disassemble many parts of my car which i can't do by myself.
that's the answer i'm looking for, so as far as i understand i can not run this screen through SCl-SDA pins, connection to RX-TX 1 or 2 or 3 is mandatory,right?
hammy:
maybe you could use A4,A5 with software serial, if you can’t move any cables, so you don’t have to change your wiring - guess you’d need to try that and alter your coding to suit
i can make it work through A4 A5, i already tried with another 2560 and it works but correct me if i'm wrong i still need to connect screen's RX-TX cables to arduino's A4&A5 right? because if i'm right that's the problem, i need to disassemble many parts of my car and that is beyond my skills, my mechanic hide my setup back inside of my dashboard only 4 cables comes from dashboard and connecting to 16x2 rgb lcd, i thought if i can make it run through SCl-SDA then i don't have to go to my mechanic to pay for disassemble my car and get out of my setup from behind the dashboard of my car.
I thought you had SCL and SDA already bought out to your old display ? I’m saying you re use those wires Re-configured as RX and TX in your software .
If you run software serial these pins can be your new RX, Tx.
You can’t run the new display without changes to your software anyway - if you hid your Arduino away with no means to communicate with it , then that’s a hard lesson learnt and you can’t change anything !
hammy:
if you hid your Arduino away with no means to communicate with it , then that’s a hard lesson learnt and you can’t change anything !
i couldn't say better It will be a good lesson for me, it's gonna cost me arround 150 Turkish lira(which is a good money in my country) like 20USD to pay to mechanic to disassemble and get out my setup. But this time i'll extend the cables and put arduino to pocket under my car's OBD port(There is a large pocket in there i don't know why they designed that way but my setup can fit there).
I just checked 15 minutes ago, guess what, i also forgot to take out an USB cable to a reachable place to re-program arduino (Here comes to dumbest man alive award),i definitely need to take out my setup from behind the hud.