Start a new topic
Not Taken

Send String TxBox But Fault

Hi all members,

I need this right code. I will want send string time to texbox.

 

  byte hour = 14;
  byte minute = 52;

  String time = "";
  time += hour;
  time += ":";
  time += minute;

  Serial.print(time);  //  EMPITY

  p1t1.setText(time);   // FAULT  //  p1t1 = t1 texbox on the page1

    


1 person likes this idea

 

byte hour = 14;
byte minute = 52;
 
String hourr = String(hour);
String minutee = String(minute);
 
String time = hourr + ":" + minutee;
 
Serial.print(hour);
Serial.print("   ");
Serial.print(minute);
Serial.print("   ");
Serial.println(time); 

t1.setText(time);  //  Fault //  no matching function for call to 'NexText::setText(String&)'

 

Image 001.png
(9.08 KB)

Update..


1 person likes this


Eu preciso desse mesmo código ... Será que alguém poderia ajudar? Comsigo enviar um número "10", mas como para enviar uma cadeia ??] o comando setText somente envia o que este "aspas duplas" ...


I need this same code ... Would someone help?Comsigo send a number "10" but how to send a string ??]the setText command only sends what this " double quotes " ...

place on your page,

  • variable hr
  • variable mn
  • text t0 (width 2x font width) for hour
  • text t1 (width 2x font width) for minutes
  • text t2 (to hold the : separator)

set in HMI t2.txt=":" (should only need this once)

send from MCU
  • hr.val=14
  • mn.val=52
  • cov hr.val,t0.txt,2
  • cov mn.val,t1.txt,2
Hope this helps



even better, place on page

  • numeric variable hr
  • numeric variable mn
  • hotspot m0
  • text t0 for hour
  • text t1 for ":"
  • text t2 for minutes
In Hotspot code for Touch Press Event
  • cov hr.val,t0.txt,2
  • cov mn.val,t1.txt,2
  • t1.txt=":"  // Just ensuring it is set

Then in MCU, if hour is same and not changed
  • mn.val=12  // set new minute value
  • click m0,1   // call hotspot m0 touch pressed function to update clock
in MCU if hour has changed as well then
  • hr.val=15 // set new hour value
  • mn.val=12 // set new minute value
  • click m0,1  // call hotspot m0 touch pressed function to update clock

This option can save some communication time in Rx/Tx over the first suggestion


1 person likes this

how we can insert special char.  <CR><LF> after a string?
printh 0X0D 0X0D result as 0x20 0x0d 0x21 0x92


thank you!

I am now reviewing all of the Feature Requests, this will take some time, patience please.

Although this wasn't a real feature request, it is now marked as reviewed.


Future questions should be posted to the Free Chat Section

Login or Signup to post a comment