Skip to content

gslc_ElemSetTxtStr not updating the text #386

Answered by Pconti31
PrattTechnologies asked this question in Q&A
Discussion options

You must be logged in to vote

@PrattTechnologies While acTxt will hold MAX_STR, pElemDol1 will only hold 6 characters plus the null so that's a dangerous way to code. No point in using snprintf if using MAX_STR as the gate value. Try,

snprintf(acTxt, 7, "%s", "1234");
gslc_ElemSetTxtStr(&m_gui, pElemDol1, acTxt);

Note the missing quotes around acTxt.

Now all that said you still should have gotten "acTxt" as a string output on your display.
If not, zip the entire project folder and post it so we can see what is going on.

You also might want to read the Builder's faq to see how to place numbers into a dynamic text field since snprintf won't do that with an Arduino.
Paul--

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@Pconti31
Comment options

@PrattTechnologies
Comment options

@elmosolutions
Comment options

Answer selected by PrattTechnologies
Comment options

You must be logged in to vote
1 reply
@elmosolutions
Comment options

Comment options

You must be logged in to vote
1 reply
@elmosolutions
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants