i'm printing out to a thermal printer, which works perfect, and can print over 2 lines:
printer.println(F(" 2 = "));
printer.println(i);
" 2 = "
'i'
but I would like to print on the same line, so it prints as " 2 = 'i' "
I think I need to create a string, but can't get the right formula. I know this is something which should be fairly simple, but I have looked at so many websites, posts etc, and tried so many different iterations over several days, and just can't nail it. any help would be appreciated. Thanks
Thank you, it really was that simple! I was obviously over complicating it. I copied the code from another website, and noticed they have '(F(', but works wether it is their or not, is it something important?
Could I now ask, I cannot print the '£' symbol. I get a Chinese character instead everytime. Is it possible to change this to print a '£'? via ascii?
And finally:
The printer has 5 wires, red and black, connected directly to a separate power supply, yellow tx, blue rx, green not connected. The fact that the printer is running ok (other than the '£'), is it really an issue that the green is loose?
The F() macro puts the string into flash memory instead of sram. This way you save some ram but it requires more time to load the value from flash. Compile it with and without the F() macro and compare the sizes of your application.
As for the '£' symbol: This might just be a display issue. I think the serial monitor uses utf-8 and the sketch uses ascii or vice-versa. I don't have an arduino around, but you can try
There is a label, but the order doesn't correspond, I have red and black for gnd and 5 v, yellow tx, and blue rx. Going by the label, green is tx, but that doesn't work
"There was a problem during the uploading of printer.jpg.
Your post has been made, however the above attachment was not attached. Please use the Back button to edit your post and submit any required changes.
Your attachment has failed security checks and cannot be uploaded. Please consult the forum administrator."
Edit2: next to the first edit, is where I put the url between the two [/img] after pressing the image button, but nothing shows. The problem message was from trying to upload from my computer.