Display_Unicode.ino 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. if use PlatformIO, need add "board_build.partitions = no_ota.csv" to config
  3. Set tools->partition scheme->'Large APP'
  4. Pls modify <m5stack path>/src/utility/In_eSPI_Setup.h, At the end of the file add "#define USE_M5_FONT_CREATOR"
  5. if want get customize unicode, try use https://github.com/m5stack/FontCreator, create font file
  6. if add "#define USE_M5_FONT_CREATOR" and want to use standard gfx font, need modify font file
  7. #ifdef USE_M5_FONT_CREATOR
  8. 0, 0,
  9. #endif
  10. like:
  11. const GFXfont FreeMono12pt7b PROGMEM = {
  12. (uint8_t *)FreeMono12pt7bBitmaps,
  13. (GFXglyph *)FreeMono12pt7bGlyphs,
  14. 0x20, 0x7E, 24,
  15. #ifdef USE_M5_FONT_CREATOR
  16. 0, 0,
  17. #endif
  18. };
  19. */
  20. #include <M5Stack.h>
  21. #include "CUF_24px.h"
  22. void setup()
  23. {
  24. M5.begin();
  25. M5.Power.begin();
  26. M5.Lcd.setTextColor(TFT_WHITE);
  27. M5.Lcd.setFreeFont(&unicode_24px);
  28. M5.Lcd.setTextDatum(TC_DATUM);
  29. }
  30. void loop()
  31. {
  32. M5.Lcd.fillScreen(0);
  33. M5.Lcd.drawString("Hello world", 160, 60, 1);
  34. M5.Lcd.drawString("你好 世界", 160, 90, 1);
  35. M5.Lcd.drawString("Здравствуй мир", 160, 120, 1);
  36. M5.Lcd.drawString("こんにちは せかい", 160, 150, 1);
  37. delay(3000);
  38. M5.Lcd.fillScreen(0);
  39. M5.Lcd.setCursor(0, 30);
  40. M5.Lcd.printf("☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓☔☕☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☸☹☺☻☼☽☾☿♀♁♂♃♄♅♆♇♈♉♊♋♌♍♎♏♐♑♒♓♔♕♖♗♘♙♚♛♜♝♞♟♠♡♢♣♤♥♦♧♨♩♪♫♬♭♮♯♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚇⚈⚉⚊⚋⚌⚍⚎⚏⚐⚑⚒⚓⚔⚕⚖⚗⚘⚙⚚⚛⚜⚝⚞⚟A⚠⚡⚢⚣⚤⚥⚦⚧⚨⚩⚪⚫⚬⚭⚮⚯B⚰⚱⚲⚳⚴⚵⚶⚷⚸⚹⚺⚻⚼⚽⚾⚿C⛀⛁⛂⛃⛄⛅⛆⛇⛈⛉⛊⛋⛌⛍⛎⛏D⛐⛑⛒⛓⛔⛕⛖⛗⛘⛙⛚⛛⛜⛝⛞⛟E⛠⛡⛢");
  41. delay(3000);
  42. M5.Lcd.fillScreen(0);
  43. M5.Lcd.setCursor(0, 30);
  44. M5.Lcd.printf("⛣⛤⛥⛦⛧⛨⛩⛪⛫⛬⛭⛮⛯F⛰⛱⛲⛳⛴⛵⛶⛷⛸⛹⛺⛻⛼⛽⛾⛿✀✁✂✃✄✅✆✇✈✉✊✋✌✍✎✏✐✑✒✓✔✕✖✗✘✙✚✛✜✝✞✟✠✡✢✣✤✥✦✧✨✩✪✫✬✭✮✯✰✱✲✳✴✵✶✷✸✹✺✻✼✽✾✿❀❁❂❃❄❅❆❇❈❉❊❋❌❍❎❏❐❑❒❓❔❕❖❗❘❙❚❛❜❝❞❟❠❡❢❣❤❥❦❧❨❩❪❫❬❭❮❯❰❱❲❳❴❵❶❷❸❹❺❻❼❽❾❿➀➁➂➃➄➅➆➇➈➉➊➋➌➍➎➏➐➑➒➓➔➕➖➗➘➙➚➛➜➝➞➟A➠➡➢➣➤➥➦➧➨➩➪➫➬➭➮➯B➰➱➲➳➴➵➶➷➸➹➺➻➼➽➾➿");
  45. delay(3000);
  46. }