Go Down

Topic: Arduino nano & nextion (Read 133 times) previous topic - next topic

jf64ard

Hello everybody

I try to send data from my arduino nano to my nextion display but it doesn't work.

I would like to send datas from arduino without libraries

I made this code :

Int SortieA = 6;

void setup() {
Sérial.begin(9600);
}

void loop () {
SortieA = 12;

Serial.print("ne.val=");
Serial.print(SortieA);
Sérial.print(0xff);
Sérial.print(0xff);
Sérial.print(0xff);

delay(200);
}

And i put
Rx-->tx
Tx-->RX

Could you help me please i m lost ?

Thank you in advance

Seithan

#1
Nov 11, 2019, 08:33 pm Last Edit: Nov 11, 2019, 08:42 pm by Seithan
Hello,

Please use the </> tag to include code.

So far,  ne  is not a valid object name, must be something like n0 or n1,n2...etc, if it is numeric, or t0,t1,t2...etc, if it is text.



Code: [Select]

Int SortieA = 6;

void setup() {
Sérial.begin(9600);
}

void loop () {
SortieA = 12;

Serial.print("ne.val="); // ne is not a valid object name. Must be something like  n0 or n1 , n2
Serial.print(SortieA);
 Serial.write(0xff); // Sérial.print(0xff); //
 Serial.write(0xff);  // Sérial.print(0xff); //
 Serial.write(0xff);  // Sérial.print(0xff); //

 // Serial.print("\xFF\xFF\xFF"); // Or you can use this instead of 3 times Serial.write
 
 
  
  

delay(200);
}



I prefer the  Serial.print("\xFF\xFF\xFF");  , as it sends ASCII .



-Thanasis Seitanis
UBUNTU:
"I am what I am, because of who we all are", compassion, kindness and humanity that connect us together by sharing  ourselves with others and caring for those around us.

Coding Badly


@jf64ard, do not hijack.  Threads split.

@jf64ard, do not cross-post.  Other thread removed.


Go Up