{"id":2046,"date":"2023-03-20T00:32:51","date_gmt":"2023-03-19T15:32:51","guid":{"rendered":"https:\/\/dalomo.net\/blog\/?p=2046"},"modified":"2023-03-20T00:32:51","modified_gmt":"2023-03-19T15:32:51","slug":"%e5%b1%b1%e8%a1%8c%e8%a8%98%e9%8c%b2%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e8%a1%8c%e5%8b%95%e3%83%ad%e3%82%b0%e3%82%92%e5%8f%96%e3%82%8a%e3%81%9f%e3%81%84%e2%91%a5-%e3%83%96%e3%82%b6%e3%83%bc%e3%83%bbo","status":"publish","type":"post","link":"https:\/\/dalomo.net\/blog\/2023\/03\/20\/2046\/","title":{"rendered":"\u5c71\u884c\u8a18\u9332\u306e\u305f\u3081\u306e\u884c\u52d5\u30ed\u30b0\u3092\u53d6\u308a\u305f\u3044\u2465 \u30d6\u30b6\u30fc\u30fbOLED"},"content":{"rendered":"<h1>\u6b63\u5e38\u52d5\u4f5c\u3057\u3066\u308b\u304b\u306e\u78ba\u8a8d\u6a5f\u80fd<\/h1>\n<p>\u3053\u3061\u3089\u306e\u5c71\u884c\u6642<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/2023\/02\/23\/1991\/\">https:\/\/dalomo.net\/blog\/2023\/02\/23\/1991\/<\/a><\/p>\n<p>\u30ed\u30ac\u30fc\u3092\u6301\u3063\u3066\u3044\u3063\u305f\u3082\u306e\u306e\u3001\u6b63\u5e38\u306b\u30ed\u30b0\u304c\u53d6\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u300213\u6642\u9593\u534a\u3082\u6b69\u3044\u305f\u306e\u306b\u3059\u3054\u304f\u60b2\u3057\u304b\u3063\u305f(\u5b9f\u969b\u5f8c\u3067\u8abf\u67fb\u3057\u305f\u3089\u6c17\u3065\u3044\u3066\u3082\u305d\u306e\u5834\u3067\u4fee\u5fa9\u3067\u304d\u308b\u3088\u3046\u306a\u3082\u306e\u3067\u306f\u306a\u304b\u3063\u305f\u304c)\u306e\u3067\u3001\u30ed\u30b0\u306e\u8a18\u9332\u306b\u7570\u5e38\u304c\u51fa\u305f\u5834\u5408\u306b\u306f\u6c17\u3065\u3051\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3002XIAO\u306e\u62e1\u5f35\u30dc\u30fc\u30c9\u306b\u306f\u30d6\u30b6\u30fc\u3001OLED\u3001\u30dc\u30bf\u30f3\u304c\u3064\u3044\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u308c\u3067\u3069\u3046\u306b\u304b\u306a\u3089\u3093\u3060\u308d\u304b\u3002<\/p>\n<h2>\u30d6\u30b6\u30fc<\/h2>\n<p>Seeeduino XIAO Expansion Board\u306b\u306f\u3082\u3068\u304b\u3089\u30d6\u30b6\u30fc\u304c\u3064\u3044\u3066\u3044\u308b\u30023\u30d4\u30f3\u3081\u304c\u3051\u3066\u30b3\u30fc\u30c9\u66f8\u3051\u3070\u826f\u3044\u3002<\/p>\n<p>\u52e2\u3044\u4f59\u3063\u3066\u30b5\u30f3\u30d7\u30eb\u4f7f\u3063\u3066\u3053\u3093\u306a\u3093\u4f5c\u3063\u305f\u3002<\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/1hJX7BmKYSY\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><a href=\"https:\/\/www.print-gakufu.com\/scene\/detail\/2117\/\">https:\/\/www.print-gakufu.com\/scene\/detail\/2117\/<\/a><\/p>\n<p>\u304c\u3001\u5b9f\u969b\u306e\u3068\u3053\u308d\u30d6\u30b6\u30fc\u3067\u306e\u304a\u77e5\u3089\u305b\u3063\u3066\u3069\u3046\u306a\u3093\u3060\u308d\u3046\u3002\u30c0\u30e1\u3060\u3063\u305f\u6642\u306b\u30d6\u30b6\u30fc\u9cf4\u3089\u3059\u306b\u3057\u3066\u3082\u3001\u305d\u308c\u304c\u3059\u3050\u76f4\u305b\u306a\u3044\u3088\u3046\u306a\u3082\u306e\u3060\u3063\u305f\u3089\u305a\u3063\u3068\u9cf4\u3063\u3066\u308b\u3002\u305d\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u4f55\u5206\u304b\u306b\u4e00\u56de\u3068\u304b\u306b\u3057\u3066\u3082\u6c17\u3065\u304b\u306a\u304b\u3063\u305f\u3089\u305d\u306e\u9593\u306e\u30ed\u30b0\u306f\u306a\u3044\u3002\u9006\u306b\u30ed\u30b0\u304c\u53d6\u308c\u3066\u308b\u3068\u304d\u306b\u9593\u6b20\u7684\u306b\u9cf4\u3089\u3059\u3068\u3057\u3066\u3082\u305a\u30fc\u3063\u3068\u805e\u3044\u3066\u305f\u3089\u6c17\u304c\u72c2\u3063\u3066\u304d\u305d\u3046\u3002\u30af\u30de\u907f\u3051\u306b\u306a\u308b\uff1f\uff57\u307e\u3041\u3053\u306e\u65b9\u6cd5\u306f\u3084\u3081\u3068\u3053\u3046\u3002<\/p>\n<h2>OLED<\/h2>\n<p>\u3058\u3083\u3042OLED\u3060\u3063\u305f\u3089\u6c17\u3065\u304f\u306e\uff1f\u3068\u8a00\u308f\u308c\u308b\u3068\u305d\u3046\u3044\u3046\u308f\u3051\u3067\u306f\u306a\u3044\u3002\u3060\u304b\u3089\u97f3\u304c\u5acc\u306a\u3093\u3060\u306a\u4ffa\u306f\u3002\u3068\u308a\u3042\u3048\u305a\u516c\u5f0f\u3067\u63d0\u793a\u3055\u308c\u3066\u3044\u308b\u30b5\u30f3\u30d7\u30eb\u3092<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2082\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled01-300x186.png\" alt=\"\" width=\"300\" height=\"186\" srcset=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled01-300x186.png 300w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled01.png 750w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/wiki.seeedstudio.com\/Seeeduino-XIAO-Expansion-Board\/#oled-display\">https:\/\/wiki.seeedstudio.com\/Seeeduino-XIAO-Expansion-Board\/#oled-display<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/olikraus\/U8g2_Arduino\">https:\/\/github.com\/olikraus\/U8g2_Arduino<\/a><\/p>\n<p>U8g2\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u4e2d\u306eU8x8\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3002<\/p>\n<h3>U8x8<\/h3>\n<blockquote><p>U8g2 also includes U8x8 library. Features for U8g2 and U8x8 are:<\/p>\n<ul>\n<li>U8g2\n<ul>\n<li>Includes all graphics procedures (line\/box\/circle draw).<\/li>\n<li>Supports many fonts. (Almost) no restriction on the font height.<\/li>\n<li>Requires some memory in the microcontroller to render the display.<\/li>\n<\/ul>\n<\/li>\n<li>U8x8\n<ul>\n<li>Text output only (character) device.<\/li>\n<li>Only fonts allowed with fixed size per character (8&#215;8 pixel).<\/li>\n<li>Writes directly to the display. No buffer in the microcontroller required.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/blockquote>\n<p><a href=\"https:\/\/github.com\/olikraus\/u8g2\/wiki\">https:\/\/github.com\/olikraus\/u8g2\/wiki<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/olikraus\/u8g2\/wiki\/fntlist8x8\">8\u00d78\u30d4\u30af\u30bb\u30eb\u306e\u30d5\u30a9\u30f3\u30c8<\/a>(\u307e\u305f\u306f\u305d\u306e\u500d\u6570?)\u3057\u304b\u4f7f\u3048\u306a\u3044\u3089\u3057\u3044\u3002\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u306e\u89e3\u50cf\u5ea6\u306f128\u00d764\u306a\u306e\u3067\u3001\u6a2a\u306f16\u6587\u5b57\u307e\u3067\u5165\u308b\u3002\u305d\u3046\u306a\u308b\u3068\u300c2023\/03\/18 23:59:59\u300d\u304c<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2083\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled02-300x180.png\" alt=\"\" width=\"300\" height=\"180\" srcset=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled02-300x180.png 300w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled02.png 750w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u3053\u3046\u306a\u308b\u3002\u5165\u3089\u306a\u3044\u3002\u3042\u3068\u65e5\u672c\u8a9e\u3092\u4f7f\u304a\u3046\u3068\u3057\u3066\u3082\u3001\u30d5\u30a9\u30f3\u30c8\u304c\u7121\u3044(\u591a\u5206)\u305f\u3081\u8868\u793a\u304c\u3067\u304d\u306a\u3044\u3002\u3061\u3085\u30fc\u3053\u3068\u3067U8g2\u306e\u65b9\u3067\u3084\u3063\u3066\u307f\u3088\u3046\u3002<\/p>\n<h3>U8g2<\/h3>\n<p>\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u304c\u304b\u306a\u308a\u8a73\u7d30\u306a\u306e\u3067\u3001\u8aad\u307f\u8fbc\u3081\u3070\u5927\u62b5\u306e\u7591\u554f\u306f\u89e3\u6c7a\u3059\u308b\u306e\u3067\u306f\u306a\u304b\u308d\u3046\u304b\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/olikraus\/u8g2\/wiki\/u8g2setupcpp\">https:\/\/github.com\/olikraus\/u8g2\/wiki\/u8g2setupcpp<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/olikraus\/u8g2\/wiki\/u8g2reference\">https:\/\/github.com\/olikraus\/u8g2\/wiki\/u8g2reference<\/a><\/p>\n<pre><code class=\"cpp\">#include &lt;Arduino.h&gt;\r\n#include &lt;SPI.h&gt;\r\n#include &lt;U8g2lib.h&gt;\r\n\r\nU8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, PIN_WIRE_SCL, PIN_WIRE_SDA);\r\n\r\nvoid setup(void) {\r\n  u8g2.begin();\r\n}\r\n\r\nvoid loop(void) {\r\n  u8g2.firstPage();\r\n  do {\r\n    u8g2.setFont(u8g2_font_b10_t_japanese2);\r\n    u8g2.drawUTF8(0, 10, \"\u3053\u3093\u306b\u3061\u306f, \u4e16\u754c!\");\r\n    u8g2.drawUTF8(0, 20, \"2023\/03\/19 23:59:59\");\r\n  } while (u8g2.nextPage());\r\n  \r\n}<\/code><\/pre>\n<p>\u3068\u308a\u3042\u3048\u305a\u52d5\u3044\u305f\u30b3\u30fc\u30c9\u3002\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bfI2C\u3067\u306a\u3093\u3067\u52d5\u304f\u306e\u3068\u8a00\u3046\u306e\u306f\u7f6e\u3044\u3068\u3044\u3066\u3001<a href=\"https:\/\/github.com\/olikraus\/u8g2\/wiki\/fntgrpefont#b10\">u8g2_font_b10_t_japanese2<\/a>\u306f\u65e5\u672c\u8a9e\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u30d5\u30a9\u30f3\u30c8\u3002\u82f1\u6570\u306e\u5834\u5408\u306f<a href=\"https:\/\/github.com\/olikraus\/u8g2\/wiki\/u8g2reference#drawstr\">drawStr<\/a>\u3067\u6587\u5b57\u3092\u8868\u793a\u3057\u305f\u304cASCII\u5916\u306e\u6587\u5b57(\u3067\u3044\u3044\u306e\u304b\u306a?)\u3092\u8868\u793a\u3059\u308b\u5834\u5408\u306f\u3001<a href=\"https:\/\/github.com\/olikraus\/u8g2\/wiki\/u8g2reference#drawutf8\">drawUTF8<\/a>\u3092\u4f7f\u3046\u3002\u7d50\u679c<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2084\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled03-300x203.png\" alt=\"\" width=\"300\" height=\"203\" srcset=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled03-300x203.png 300w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled03.png 750w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u6b63\u76f4\u306b\u8a00\u3046\u3068\u3001\u65e5\u672c\u8a9e\u306e\u5b57\u5f62\u306f\u304a\u304b\u3057\u304f\u611f\u3058\u308b\u3002\u300c\u3093\u3061\u300d\u306f\u9014\u4e2d\u3067\u5207\u308c\u3066\u3044\u308b\u3057\u3001\u5168\u4f53\u7684\u306b\u30d0\u30e9\u30f3\u30b9\u304c\u60aa\u3044\u3002\u307e\u305f\u53e5\u8aad\u70b9\u300c\u3001\u3002\u300d\u306a\u3069\u306f\u53ce\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u3088\u3046\u3060\u3002\u307e\u305f\u3001\u82f1\u6570\u3068\u8a18\u53f7\u3060\u3051\u3067\u3082\u6587\u5b57\u5e45\u306e\u30d4\u30af\u30bb\u30eb\u304c\u9055\u3046\u3088\u3046\u3067\u5168\u4f53\u7684\u306a\u7d71\u4e00\u611f\u306b\u6b20\u3051\u308b\u304b\u306a\u3068\u3044\u3046\u5370\u8c61\u3060\u3063\u305f\u3002\u305f\u3060\u4ed6\u306b\u30d5\u30a9\u30f3\u30c8\u304c\u306a\u3055\u305d\u3046\u3002\u65e2\u5b58\u30d5\u30a9\u30f3\u30c8\u3092\u5229\u7528\u3067\u304d\u306a\u3044\u304b\u306a\u30fc\uff1f<\/p>\n<h2>U8g2\u3067\u5916\u90e8\u30d5\u30a9\u30f3\u30c8\u3092\u4f7f\u3046<\/h2>\n<p>\u3067\u3001\u4ee5\u524d\u4f7f\u3063\u305f\u3053\u3068\u304c\u3042\u308b\u7f8e\u54b2\u30d5\u30a9\u30f3\u30c8\u304c\u4f7f\u3048\u306a\u3044\u304b\u306a\u3068\u601d\u3063\u305f\u3002<\/p>\n<p><a href=\"https:\/\/littlelimit.net\/misaki.htm\">https:\/\/littlelimit.net\/misaki.htm<\/a><\/p>\n<p>U8g2\u3067\u5916\u90e8\u30d5\u30a9\u30f3\u30c8\u3092\u4f7f\u3046\u65b9\u6cd5\u3092\u8abf\u3079\u305f\u3068\u3053\u308dFAQ\u306b\u8a18\u8ff0\u304c\u3042\u3063\u305f\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/olikraus\/u8g2\/blob\/master\/doc\/faq.txt#L245\">https:\/\/github.com\/olikraus\/u8g2\/blob\/master\/doc\/faq.txt#L245<\/a><\/p>\n<p>\u3053\u3061\u3089\u3092\u898b\u306a\u304c\u3089\u3084\u3063\u3066\u3044\u304f\u3002\u7c21\u5358\u306b\u3044\u3046\u3068bdf\u5f62\u5f0f\u306e\u30d5\u30a9\u30f3\u30c8\u30c7\u30fc\u30bf\u304b\u3089\u5909\u63db\u3059\u308b\u3089\u3057\u3044\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u307e\u305a\u7f8e\u54b2\u30d5\u30a9\u30f3\u30c8\u306eX11 BDF \u5f62\u5f0f\u3092\u5165\u624b\u3057\u3066\u304d\u3066\u304a\u304f\u3002\u305d\u3093\u3067<\/p>\n<p><a href=\"https:\/\/github.com\/olikraus\/u8g2\/tree\/master\/tools\/font\/bdfconv\">https:\/\/github.com\/olikraus\/u8g2\/tree\/master\/tools\/font\/bdfconv<\/a><\/p>\n<p>\u304b\u3089bdfconv.exe\u3092\u5165\u624b(Windows\u306e\u5834\u5408)\u3002\u9069\u5f53\u306a\u540c\u3058\u30d5\u30a9\u30eb\u30c0\u306b\u5165\u308c\u3066\u304a\u304f\u3002\u4eca\u56de\u306fC:\\tmp\\font\u5185\u306bmisaki_gothic.bdf\u3068bdfconv.exe\u3092\u914d\u7f6e\u3057\u305f\u3002\u305d\u3057\u305f\u3089\u5909\u63db\u7528\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u308b\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/olikraus\/u8g2\/blob\/master\/doc\/faq.txt#L261\">https:\/\/github.com\/olikraus\/u8g2\/blob\/master\/doc\/faq.txt#L261<\/a><\/p>\n<p>\u3053\u3053\u306e\u8aac\u660e\u304b\u3089\u3001\u30e6\u30cb\u30b3\u30fc\u30c9\u306e\u3069\u306e\u90e8\u5206\u3092\u5909\u63db\u3059\u308b\u304b\u306e\u6307\u5b9a\u3092\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u3002\u305d\u306e\u52a9\u3051\u3068\u306a\u308b\u306e\u304c<\/p>\n<p><a href=\"https:\/\/stncrn.github.io\/u8g2-unifont-helper\/\">https:\/\/stncrn.github.io\/u8g2-unifont-helper\/<\/a><\/p>\n<p>\u3053\u3061\u3089\u306b\u5fc5\u8981\u4e8b\u9805\u3092\u5165\u529b\u3057\u3066\u3044\u304f\u3068\u30b3\u30de\u30f3\u30c9\u3092\u767a\u884c\u3057\u3066\u304f\u308c\u308b\u3002Character ranges\u306e\u90e8\u5206\u306f\u9069\u5f53\u306bBasic Latin\u3068CJK Symbols and Punctuation\u3001Hiragana\u3001Katakana\u3001CJK Unified Ideographs\u3001Halfwidth and Fullwidth Forms\u306b\u3057\u305f\u3002\u3053\u3046\u3057\u3066\u3067\u304d\u305f\u30b3\u30de\u30f3\u30c9\u304c\u3053\u308c\u3002<\/p>\n<pre>bdfconv -v -f 1 -m \"0-127,12288-12351,12352-12447,12448-12543,19968-40959,65280-65519\" misaki_gothic.bdf -o misaki_gothic.c -n misaki_gothic -d misaki_gothic.bdf<\/pre>\n<p>\u3053\u308c\u3092\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u5b9f\u884c\u3057\u3066\u307f\u308b\u3068<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/cmd1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2075\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/cmd1-300x162.png\" alt=\"\" width=\"300\" height=\"162\" srcset=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/cmd1-300x162.png 300w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/cmd1-1024x553.png 1024w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/cmd1-768x415.png 768w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/cmd1.png 1366w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u540c\u30d5\u30a9\u30eb\u30c0\u5185\u306bbdf.tga\u3068misaki_gothic.c\u304c\u4f5c\u6210\u3055\u308c\u305f\uff01<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/bdf.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2077\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/bdf-190x300.png\" alt=\"\" width=\"190\" height=\"300\" srcset=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/bdf-190x300.png 190w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/bdf.png 198w\" sizes=\"auto, (max-width: 190px) 100vw, 190px\" \/><\/a><\/p>\n<p>bdf.tga\u306f\u30d5\u30a9\u30f3\u30c8\u306e\u4e00\u89a7\u307f\u305f\u3044(\u753b\u50cf\u306f\u4e00\u90e8\u3092png\u306b\u5909\u63db)\u3002\u3067\u304d\u305fc\u30d5\u30a1\u30a4\u30eb\u3092Arduino\u3067\u8aad\u307f\u8fbc\u3080\u3002Sketch\u2192Add file&#8230;\u3067misaki_gothic.c\u3092\u6307\u5b9a\u3059\u308c\u3070\u3088\u3044\u3002\u305d\u3057\u305f\u3089\u30b3\u30fc\u30c9\u5185\u3067\u4f7f\u3046\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3002<\/p>\n<pre><code class=\"cpp\">#include &lt;Arduino.h&gt;\r\n#include &lt;SPI.h&gt;\r\n#include &lt;U8g2lib.h&gt;\r\n#include \"misaki_gothic.c\"\r\n\r\nU8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, PIN_WIRE_SCL, PIN_WIRE_SDA);\r\n\r\nvoid setup(void) {\r\n  u8g2.begin();\r\n}\r\n\r\nvoid loop(void) {\r\n  u8g2.firstPage();\r\n  do {\r\n    u8g2.setFont(misaki_gothic);\r\n    u8g2.drawUTF8(0, 8, \"Hello, World!\");\r\n    u8g2.drawUTF8(0, 16, \"\u3053\u3093\u306b\u3061\u306f\u3001\u4e16\u754c\uff01\");\r\n    u8g2.drawUTF8(0, 24, \"2023\/03\/19 23:59:59\");\r\n  } while (u8g2.nextPage());\r\n  \r\n}<\/code><\/pre>\n<p>include\u3067\u8ffd\u52a0\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u3001setFont\u3067\u30d5\u30a9\u30f3\u30c8\u540d\u3092\u6307\u5b9a\u3059\u308b\u3002\u5b9f\u884c\u3057\u3066\u307f\u308b\u3068<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled04.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2085\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled04-300x181.png\" alt=\"\" width=\"300\" height=\"181\" srcset=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled04-300x181.png 300w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled04.png 750w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u305f\u3093\u3068\u8868\u793a\u3055\u308c\u307e\u3057\u305f\uff5e\u3002<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled05.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2086\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled05-300x179.png\" alt=\"\" width=\"300\" height=\"179\" srcset=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled05-300x179.png 300w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled05.png 750w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u5bff\u9650\u7121\u3068\u304b\u3082\u8868\u793a\u3067\u304d\u308b\u3088\u3002<\/p>\n<h2>U8g2\u30672\u5024\u753b\u50cf\u3092\u8868\u793a\u3059\u308b<\/h2>\n<p>\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u8aad\u3093\u3067\u305f\u3089\u56f3\u5f62\u7b49\u3082\u8868\u793a\u3067\u304d\u308b\u3053\u3068\u3092\u77e5\u3063\u305f\u3002\u4ed6\u306b\u3082<a href=\"https:\/\/github.com\/olikraus\/u8g2\/wiki\/u8g2reference#drawxbm\">XBM\u3068\u3044\u3046\u5f62\u5f0f\u306e2\u5024\u753b\u50cf\u304c\u8868\u793a\u3067\u304d\u308b<\/a>\u3088\u3046\u3067\u3001\u3053\u306e\u30b5\u30a4\u30c8\u306efavicon\u3092\u8868\u793a\u3057\u3066\u307f\u305f\u304f\u306a\u3063\u305f\u3002<\/p>\n<h3>\u753b\u50cf\u306e\u6e96\u5099<\/h3>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/icon16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2079\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/icon16.png\" alt=\"\" width=\"16\" height=\"16\" \/><\/a><\/p>\n<p>\u3082\u3068\u3082\u3068\u306e\u753b\u50cf\u304c\u3053\u3061\u3089\u3067\u3001\u3053\u308c\u30922\u5024\u5316\u3059\u308b\u3002\u3053\u308c\u306f\u9069\u5f53\u306b\u624b\u4f5c\u696d\u3067<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/icon16_bin.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2080\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/icon16_bin.png\" alt=\"\" width=\"16\" height=\"16\" \/><\/a><\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3002\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u304c\u9ed2\u80cc\u666f\u306a\u305f\u3081\u56db\u9685\u3092\u4e38\u304f\u3057\u6d6e\u304b\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u3002\u307e\u305f\u80cc\u666f\u306f\u900f\u904e\u306b\u3059\u308b\u306e\u3067\u306a\u304f\u8272\u3092\u7f6e\u3044\u305f\u3002\u753b\u50cf\u3067\u9ed2\u304c\u7f6e\u304b\u308c\u305f\u3068\u3053\u308d\u304c\u70b9\u706f\u3057\u767d\u8272\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u308b\u305f\u3081\u3001\u30cd\u30ac\u30dd\u30b8\u306f\u53cd\u8ee2\u3057\u306a\u3044\u3068\u4e0a\u624b\u304f\u8868\u793a\u3055\u308c\u306a\u3044\u3002\u305d\u3057\u305f\u3089\u3053\u306e\u753b\u50cf\u3092XBM\u306b\u5909\u63db\u3059\u308b\u3002\u5909\u63db\u30c4\u30fc\u30eb\u306f\u3044\u308d\u3093\u306a\u306e\u304c\u3042\u308b\u304c\u3001<\/p>\n<p><a href=\"https:\/\/convertio.co\/ja\/xbm-converter\/\">https:\/\/convertio.co\/ja\/xbm-converter\/<\/a><\/p>\n<p>\u3068\u304b\u3002\u4eca\u56de\u306f\u691c\u7d22\u3057\u3066\u6700\u521d\u306b\u51fa\u3066\u304d\u305f\u3084\u3064\u306b\u3057\u305f\u3002\u5909\u63db\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3002XBM\u306e\u5b9f\u614b\u306f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306a\u306e\u3067\u3001VSC\u3068\u304b\u3067\u958b\u304f\u3068<\/p>\n<pre><code class=\"cpp\">#define dalomo_width 16\r\n#define dalomo_height 16\r\nstatic char dalomo_bits[] = {\r\n  0xF8, 0x1D, 0x4C, 0x35, 0x18, 0x34, 0x03, 0xD0, 0x06, 0xE0, 0x06, 0x00, \r\n  0xC1, 0x43, 0xE3, 0xC7, 0x63, 0xC6, 0x43, 0xC2, 0x00, 0x80, 0x85, 0xA1, \r\n  0x0F, 0xE0, 0x26, 0x6C, 0xB0, 0x0D, 0xF8, 0x1C, };<\/code><\/pre>\n<p>\u307f\u305f\u3044\u306a\u8868\u793a\u306b\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3002\u5909\u6570\u540d\u304c\u9577\u3044\u306e\u3067\u9069\u5f53\u306b\u76f4\u3057\u305f\u3002\u3053\u308c\u3067\u753b\u50cf\u3092\u5909\u63db\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u3002<\/p>\n<h3>\u30b9\u30b1\u30c3\u30c1<\/h3>\n<p>\u3053\u308c\u3092\u305d\u306e\u307e\u307e\u30b9\u30b1\u30c3\u30c1\u306b\u8ffd\u52a0\u3057\u3066\u30b3\u30d4\u30fc\u3059\u308b\u3068<\/p>\n<pre><code class=\"cpp\">#include &lt;Arduino.h&gt; \r\n#include &lt;SPI.h&gt; \r\n#include &lt;U8g2lib.h&gt;\r\n#include \"misaki_gothic.c\"\r\n\r\n#define dalomo_width 16\r\n#define dalomo_height 16\r\nstatic unsigned char dalomo_bits[] = {\r\n  0xF8,  0x1D,  0x4C,  0x35,  0x18,  0x34,\r\n  0x03,  0xD0,  0x06,  0xE0,  0x06,  0x00,\r\n  0xC1,  0x43,  0xE3,  0xC7,  0x63,  0xC6,\r\n  0x43,  0xC2,  0x00,  0x80,  0x85,  0xA1,\r\n  0x0F,  0xE0,  0x26,  0x6C,  0xB0,  0x0D,\r\n  0xF8,  0x1C,\r\n};\r\n\r\nU8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, PIN_WIRE_SCL, PIN_WIRE_SDA);\r\n\r\nvoid setup(void) {\r\n  u8g2.begin();\r\n}\r\n\r\nvoid loop(void) {\r\n  u8g2.firstPage();\r\n  do {\r\n    u8g2.setFont(misaki_gothic);\r\n    u8g2.drawUTF8(0, 8, \"2023\/03\/19 23:59:59\");\r\n    u8g2.drawUTF8(0, 16, \"\u7def\u5ea6:35.6825\");\r\n    u8g2.drawUTF8(0, 24, \"\u7d4c\u5ea6:139.752778\");\r\n    u8g2.drawUTF8(0, 32, \"\u9ad8\u5ea6:10 m\");\r\n    u8g2.drawUTF8(0, 40, \"\u6e29\u5ea6:17 \u5ea6\");\r\n    u8g2.drawUTF8(0, 48, \"\u6c17\u5727:1013 hPa\");\r\n\r\n    u8g2.drawXBM(112, 48, dalomo_width, dalomo_height, dalomo_bits);\r\n  } while (u8g2.nextPage());\r\n}<\/code><\/pre>\n<p>\u6c17\u3092\u3064\u3051\u308b\u70b9\u3068\u3057\u3066dalomo_bits\u306e\u578b\u3092unsigned char\u306b\u5909\u66f4\u3057\u3066\u304a\u304f\u3002\u5b9f\u884c\u3059\u308b\u3068<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled06.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2087\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled06-300x163.png\" alt=\"\" width=\"300\" height=\"163\" srcset=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled06-300x163.png 300w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled06.png 750w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u8868\u793a\u3055\u308c\u305f\uff01\u3061\u3087\u3063\u3068\u30ac\u30bf\u3064\u3044\u3066\u3093\u306a\u3002\u307e\u3041\u3044\u3063\u304b\uff01\u305d\u3057\u305f\u3089\u884c\u52d5\u30ed\u30ac\u30fc\u306b\u7d44\u307f\u8fbc\u3093\u3067\u3044\u3053\u3046\u3002<\/p>\n<h2>\u884c\u52d5\u30ed\u30ac\u30fc\u306e\u30b9\u30b1\u30c3\u30c1\u3092\u66f4\u65b0\u3059\u308b<\/h2>\n<pre><code>#include &lt;SoftwareSerial.h&gt;\r\n#include \"TinyGPS++.h\"\r\n#include &lt;Dps310.h&gt;\r\n#include &lt;SPI.h&gt;\r\n#include &lt;SD.h&gt;\r\n#include &lt;U8g2lib.h&gt;\r\n#include \"misaki_gothic.c\"\r\n\r\n#define dalomo_width 16\r\n#define dalomo_height 16\r\nstatic unsigned char dalomo_bits[] = {\r\n  0xF0, 0x0D, 0x4C, 0x35, 0x18, 0x34, 0x02, 0x50, 0x07, 0xE0, 0x06, 0x00, \r\n  0xC1, 0x43, 0xE3, 0xC7, 0x63, 0xC6, 0x43, 0xC2, 0x00, 0x80, 0x85, 0xA1, \r\n  0x0F, 0x60, 0x26, 0x6C, 0xB0, 0x0D, 0xF0, 0x1C, };\r\n\r\n\r\nTinyGPSPlus gps;\r\nSoftwareSerial mySerial(7, 6);\r\n\r\nDps310 Dps310PressureSensor = Dps310();\r\n\r\nU8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0);\r\n\r\nconst int chipSelect = 2;\r\nString fileName;\r\nFile root;\r\n\r\nString dataString;\r\n\r\nvoid setup() {\r\n  Serial.begin(57600);\r\n  mySerial.begin(9600);\r\n\r\n  u8g2.begin();\r\n  u8g2.setFont(misaki_gothic);\r\n\r\n  Dps310PressureSensor.begin(Wire);\r\n\r\n  if (!SD.begin(chipSelect)) {\r\n    while (1)\r\n      ;\r\n  }\r\n  root = SD.open(\"\/\");\r\n  checkDupFile(root, 0);\r\n}\r\n\r\nvoid loop() {\r\n  float temperature;\r\n  float pressure;\r\n  uint8_t oversampling = 7;\r\n  int16_t ret;\r\n  String ymd;\r\n  String hms;\r\n\r\n  u8g2.firstPage();\r\n\r\n  while (mySerial.available() &gt; 0) {\r\n    char c = mySerial.read();\r\n    gps.encode(c);\r\n    if (gps.time.isUpdated() || gps.date.isUpdated() || gps.location.isUpdated()) {  \/\/if (gps.location.isUpdated() &amp;&amp; gps.time.isValid()) {\/\/\r\n\r\n      ymd += gps.date.year();\r\n      ymd += \"\/\";\r\n      if (gps.date.month() &lt; 10) ymd += \"0\";\r\n      ymd += gps.date.month();\r\n      ymd += \"\/\";\r\n      if (gps.date.day() &lt; 10) ymd += \"0\";\r\n      ymd += gps.date.day();\r\n      dataString += ymd + \",\";\r\n\r\n      if (gps.time.hour() &lt; 10) hms += \"0\";\r\n      hms += gps.time.hour();\r\n      hms += \":\";\r\n      if (gps.time.minute() &lt; 10) hms += \"0\";\r\n      hms += gps.time.minute();\r\n      hms += \":\";\r\n      if (gps.time.second() &lt; 10) hms += \"0\";\r\n      hms += gps.time.second();\r\n      dataString += hms + \",\";\r\n\r\n      dataString += String(gps.location.lat(), 7);\r\n      dataString += \",\";\r\n      dataString += String(gps.location.lng(), 7);\r\n      dataString += \",\";\r\n      dataString += String(gps.altitude.meters());\r\n      dataString += \",\";\r\n\r\n      ret = Dps310PressureSensor.measureTempOnce(temperature, oversampling);\r\n\r\n      if (ret != 0) {\r\n        Serial.print(\"FAIL! ret = \");\r\n        Serial.println(ret);\r\n      } else {\r\n        dataString += String(temperature);\r\n      }\r\n\r\n      dataString += \",\";\r\n\r\n      ret = Dps310PressureSensor.measurePressureOnce(pressure, oversampling);\r\n      if (ret != 0) {\r\n        Serial.print(\"FAIL! ret = \");\r\n        Serial.println(ret);\r\n      } else {\r\n        dataString += String(pressure);\r\n      }\r\n\r\n      File dataFile = SD.open(fileName, FILE_WRITE);\r\n      if (dataFile) {\r\n        dataFile.println(dataString.c_str());\r\n        dataFile.close();\r\n      }\r\n\r\n      do {\r\n        u8g2.drawStr(0, 9, (ymd + \" \" + hms).c_str());\r\n        u8g2.drawUTF8(0, 18, (\"\u7def\u5ea6 : \" + String(gps.location.lat(), 7)).c_str());\r\n        u8g2.drawUTF8(0, 27, (\"\u7d4c\u5ea6 : \" + String(gps.location.lng(), 7)).c_str());\r\n        u8g2.drawUTF8(0, 36, (\"\u9ad8\u5ea6 : \" + String(gps.altitude.meters()) + \" m\").c_str());\r\n        u8g2.drawUTF8(0, 45, (\"\u6e29\u5ea6 : \" + String(temperature)).c_str());\r\n        u8g2.drawUTF8(0, 54, (\"\u6c17\u5727 : \" + String(pressure) + \" Pa\").c_str());\r\n        u8g2.drawXBM(112, 48, dalomo_width, dalomo_height, dalomo_bits);\r\n      } while (u8g2.nextPage());\r\n\r\n      ymd = \"\";\r\n      hms = \"\";\r\n      dataString = \"\";\r\n    }\r\n  }\r\n}\r\n\r\nvoid checkDupFile(File dir, int num) {\r\n  bool existFile = false;\r\n  while (true) {\r\n    File entry = dir.openNextFile();\r\n    if (!entry) {\r\n      if (num == 0) {\r\n        fileName = \"LOG0.CSV\";\r\n      }\r\n      break;\r\n    }\r\n\r\n    num++;\r\n    fileName = \"LOG\" + String(num) + \".CSV\";\r\n  }\r\n}<\/code><\/pre>\n<p>\u307b\u3093\u3068\u306b\u305f\u3060\u8ffd\u52a0\u3057\u305f\u3060\u3051\u3002\u884c\u9593\u306f\u3061\u3087\u3063\u3068\u958b\u3051\u305f\u3002<\/p>\n<p><a href=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2089\" src=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled07-300x157.png\" alt=\"\" width=\"300\" height=\"157\" srcset=\"https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled07-300x157.png 300w, https:\/\/dalomo.net\/blog\/wp-content\/uploads\/2023\/03\/oled07.png 750w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u3068\u308a\u307e\u304a\u3063\u3051\u30fc\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6b63\u5e38\u52d5\u4f5c\u3057\u3066\u308b\u304b\u306e\u78ba\u8a8d\u6a5f\u80fd \u3053\u3061\u3089\u306e\u5c71\u884c\u6642 https:\/\/dalomo.net\/blog\/2023\/02\/23\/1991\/ \u30ed\u30ac\u30fc\u3092\u6301\u3063\u3066\u3044\u3063\u305f\u3082\u306e\u306e\u3001\u6b63\u5e38\u306b\u30ed\u30b0\u304c\u53d6\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u300213\u6642\u9593\u534a\u3082\u6b69\u3044\u305f\u306e\u306b\u3059\u3054\u304f\u60b2\u3057\u304b\u3063 &hellip; <a href=\"https:\/\/dalomo.net\/blog\/2023\/03\/20\/2046\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2086,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[69,188,183],"class_list":["post-2046","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-8","tag-arduino","tag-u8g2","tag-183"],"_links":{"self":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/2046","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/comments?post=2046"}],"version-history":[{"count":8,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/2046\/revisions"}],"predecessor-version":[{"id":2090,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/2046\/revisions\/2090"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/media\/2086"}],"wp:attachment":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/media?parent=2046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/categories?post=2046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/tags?post=2046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}