hi, i understand you can use * to specify dynamic formatting, but whenever i try this i can't see anything in the Serial prompt, but if i use it hardcode, it works.
dynamic formatting for sprintf means, that instead of specfying "%20d, the 20 would come from one of the variables in the call.
so in here, the * is actually being replaced by the 20
sprintf(buf,"%*s",20,buffer);
It also, ,at least on AVRS does not support the "f" specifier. And "lf" is precisely the same as "f" in any proper c/c++ implementation. All floats are, by default, promoted to double for printf arguments. And, of course, AVR Arduinos do not even support double - a double it exactly the same as a float.
thanks i was afraid of that, although actually i'm aiming for the %s rather than the float , guess i'm gonna hack it myself, although that doesn't work either..
As mentioned by @westfw, sprintf for Arduino has been emasculated for space reasons. I do recall though that there is a way to get %f working - presumably by replacing the library responsible. It might be worth a little research to see if it actually gives you the full monty.
thanks @johnwasser and everyone, i'll try those, what i'm currently trying to do and failing is using clang-tidy in platform.io which should at least be able to give me SOME warnings like the ones about the length of buffer and sprintf, but it fails becuase it also gives me errors on the avr system libraries which i can't get rid off.
what's some stranger, is that i've noticed that at some points the LCD flickers very fast and not sure why.. i have don't place any delays in my loop when i update the LCD
not exctly, the first line is updated all the time, during development i also display the seconds, which is why i refresh it
the other 3 lines are displayed only the date changes (or when i press button to change the date)
btw as you can see the lines can change very dynamically and i can' clear them i get remains of letters.
i'm working on uploading the code on github, but i was planning to re-regonize it first a little bit .
looks like quite a bit of code i'm not enthusiastic about digging thru, especially without clearly understanding the problem. the display wrapper around the lcd functions seems unnecessary
i thought the characters looked like hebrew but initially thought they were corrupted. now i see it's for a Jewish clock
not clear what the problem is. guessing you may be partially updating with a line shorter than the one previously displayed.
if so, you could clear and completely update all lines on the display, or if you want to partially update a line using col/row, make sure you append spaces to the c-string being passed so that the # of cols is the same each time
that's why i couldn't exactly post the code :), the LCDWrapper was meant to absract the LCD api's incase i might change them, (for example switching to an OLED display)
i'll try to re-create it. not sure how far i'll go with the clang-tidy