Hi All,
Can someone give me the DRAWTEXT syntax to include text, then a variable, then text, then another variable?
Example:
VARa=60;
VARb=10;
ReefAngel.LCD.DrawText(0,255,x,y,"RC" VARa "% +/- " VARb "%");
I want it to say
RC 60% +/-10%
Syntax of DRAWTEXT with variables
Re: Syntax of DRAWTEXT with variables
I dont think you can do that with DrawText by itself. You can use sprintf to create the string and then use DrawText to display it.
char buf[16];
sprintf(buf,"RC %d% +/-%d%",VarA,VarB);
char buf[16];
sprintf(buf,"RC %d% +/-%d%",VarA,VarB);
Re: Syntax of DRAWTEXT with variables
lnevo wrote:I dont think you can do that with DrawText by itself. You can use sprintf to create the string and then use DrawText to display it.
char buf[16];
sprintf(buf,"RC %d% +/-%d%",VarA,VarB);
eww. not elegant, huh?
Would my code look like this?
char buf[16];
sprintf(buf,"RC %d% +/-%d%",wpWavStr,wpWavOff);
ReefAngel.LCD.DrawText(0,255,x,y,buf);
Re: Syntax of DRAWTEXT with variables
Yes. Keep in mind i'm writing the code on my phone...i'm doing that in a few places in my INO you can reference.
Re: Syntax of DRAWTEXT with variables
lnevo wrote:Yes. Keep in mind i'm writing the code on my phone...i'm doing that in a few places in my INO you can reference.
Again, Thank you so much. I'll review your code.