I am using an Arduino Mega to control a Gen4-uLCD-50DT-A Display.
I have some int, float and string variables that I wish to print on the display. I tried all possible combinations that came to my mind but something doesn't seem to be working.
I read somewhere that one has to store the possible strings in the dynamic string element when still in the design process. I don't wanna do this. I need the Arduino to print certain variables to the screen since the user can change these variables while the system is in use. How do I go about doing that?
I am using Workshop 4 to create the display design. I tried both static text and strings under the "labels" tab.
In the following cases I am trying to write the float variable "V_End" to the String element with index 1. Here are some code lines I tried using:
genie.WriteStr(1, V_End): Here, I tried printing the variable directly
genie.WriteStr(1, String(V_End)): Here, I tried casting the variable as a String before printing it
genie.WriteStr(1, V_End): Here, I had changed the variable type to String and then tried printing it
genie.WriteStr(1, "Test"): Here, I tried printing a string directly without a variable.
All these did not work. I then tried the same combinations but with a static text element. For example:
genie.WriteObject(GENIE_OBJ_STATIC_TEXT, 15, V_End): 15 is the element index and V_End is my float variable
genie.WriteObject(GENIE_OBJ_STATIC_TEXT, 21, 5): here I tried printing an integer (5)
genie.WriteObject(GENIE_OBJ_STATIC_TEXT, 22, "Test"): Here I tried to print a string directly
I can't seem to be getting the hang of it and I'm thankful for suggestions!
Rami
I have some int, float and string variables that I wish to print on the display. I tried all possible combinations that came to my mind but something doesn't seem to be working.
I read somewhere that one has to store the possible strings in the dynamic string element when still in the design process. I don't wanna do this. I need the Arduino to print certain variables to the screen since the user can change these variables while the system is in use. How do I go about doing that?
I am using Workshop 4 to create the display design. I tried both static text and strings under the "labels" tab.
In the following cases I am trying to write the float variable "V_End" to the String element with index 1. Here are some code lines I tried using:
genie.WriteStr(1, V_End): Here, I tried printing the variable directly
genie.WriteStr(1, String(V_End)): Here, I tried casting the variable as a String before printing it
genie.WriteStr(1, V_End): Here, I had changed the variable type to String and then tried printing it
genie.WriteStr(1, "Test"): Here, I tried printing a string directly without a variable.
All these did not work. I then tried the same combinations but with a static text element. For example:
genie.WriteObject(GENIE_OBJ_STATIC_TEXT, 15, V_End): 15 is the element index and V_End is my float variable
genie.WriteObject(GENIE_OBJ_STATIC_TEXT, 21, 5): here I tried printing an integer (5)
genie.WriteObject(GENIE_OBJ_STATIC_TEXT, 22, "Test"): Here I tried to print a string directly
I can't seem to be getting the hang of it and I'm thankful for suggestions!
Rami
Comment