lesthegrngo Posted April 27, 2023 Author Posted April 27, 2023 (edited) Here's the entire .c file, is this all there should be? Cheers ****EDIT**** added the .bdf file too Les SEG14.c DSEG14Classic-Bold-54.bdf Edited April 27, 2023 by lesthegrngo
Vinc_Vega Posted April 27, 2023 Posted April 27, 2023 (edited) Hi Les, the name of your font is "SEG14" so the line must read as follows u8g2.setFont(SEG14); But even if there are no compiling errors, the font is not displayed. EDIT: Have a look at Olli Kraus's webite (the author of U8g2) how to convert fonts. https://github.com/olikraus/u8g2/issues/1140 He even has an example there of the 14 segment font at the end of the page. Unfortunately the height is 18pt (20 pixels). Regards, Vinc Edited April 27, 2023 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
lesthegrngo Posted April 28, 2023 Author Posted April 28, 2023 Thanks Vinc and Outbaxx, I finally got it working My bdfconv files were not appending the headers with "u8g2_font_" hence the error for the callout. Once I figured that out and added "u8g2_font_" in front of the font name the fonts I was creating started working. So it is now showing the correct numbers and at the correct height, I will have to play with the actual bitmaps a bit to make them nicer. However it is a bit weird that there is no full stop / decimal point included in the font, and when you go to a font editor, the character space is blanked out that corresponds to the decimal point. Unfortunately that is a necessary glyph, so my next task is how to incorporate it in the font Cheers Les
lesthegrngo Posted April 28, 2023 Author Posted April 28, 2023 Ok, all, job done! I found another font that had the decimal point in it, and used Fony to basically redo all the numerical characters and decimal point to suit my sketch. And boy am I happy at how it turned out! The characters look great, the spacing of the characters is perfect for my fascia, and it works perfectly with the Nano. For anyone interested I have included the sketch below for download, remember that this is for the 2.08" SH1122 OLED but you can probably use the guts of it to suit another OLED. Now, just because I like a challenge I am going to see if I can get a 0.66" i2C OLED to run from the same Nano. Once more, thanks to Vinc and Outbaxx for their help on this Les 208OLEDUHF_with_go_wait_SEG14_LCD5.ino 2
lesthegrngo Posted April 28, 2023 Author Posted April 28, 2023 (edited) Well, a lot easier than I thought, I managed to make two instances of the OLEDs and it worked first time. I’ll have to make a second smaller font to match the smaller OLED, but that should be easy now I’ve learned how to do it Les Edited April 28, 2023 by lesthegrngo
lesthegrngo Posted April 29, 2023 Author Posted April 29, 2023 Here you are for anyone that is interested. This sketch displays the UHF frequency on a 2.08" OLED and the UHF Preset on a 0.66" OLED with 14 Segment LCD type fonts sized to match Cheers Les 208OLEDUHF_with_go_wait_SEG14_LCD5_plus_066_OLED.ino
Recommended Posts