UdonLibrary 1.0.0
機械システム研究部 C++ ライブラリ
読み取り中…
検索中…
一致する文字列を見つけられません
Lcd.hpp
[詳解]
1//
2// 通信用メッセージ
3//
4// Copyright (c) 2022-2024 udonrobo
5//
6
7#pragma once
8
9#include <stdarg.h>
10#include <stdint.h>
12
13namespace Udon
14{
15
16 namespace Message
17 {
18
22 template <size_t Column, size_t Row>
23 struct Lcd
24 {
26 char text[Row][Column];
27
31 void printf(size_t index, const char* format, ...)
32 {
33 va_list args;
34 va_start(args, format);
35 vsnprintf(text[index], Column, format, args);
36 va_end(args);
37 }
38
39#ifdef ARDUINO
41 void show() const
42 {
43 Serial.print(F("lcd: "));
44 for (auto&& row : text)
45 {
46 Serial.println(row);
47 }
48 }
49#endif
50
52 };
53
56
59
60 } // namespace Message
61
62} // namespace Udon
#define F(x)
Definition Show.hpp:17
Definition Bit.hpp:12
LCD
Definition Lcd.hpp:24
void printf(size_t index, const char *format,...)
LCDに文字列を設定
Definition Lcd.hpp:31
char text[Row][Column]
LCDのテキスト
Definition Lcd.hpp:26