Advertisement
mikroavr

nextion_text_arduino

Aug 18th, 2021
1,650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void setup() {
  2.   Serial.begin(115200);
  3.   Serial2.begin(9600, SERIAL_8N1, 22, 21);
  4. }
  5.  
  6. void loop() {
  7.   tampil_text("t0", "test text");
  8.   tampil_text("t1", "mikroavr.com");
  9.   delay(1000);
  10. }
  11.  
  12. void tampil_text(String _add_txt, String _txt_display) {
  13.   String buf_txt = _add_txt + ".txt="  + "\"" + _txt_display + "\"";  
  14.   Serial2.print(buf_txt);
  15.   Serial2.write(0xff);
  16.   Serial2.write(0xff);
  17.   Serial2.write(0xff);
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement