UdonLibrary 1.0.0
機械システム研究部 C++ ライブラリ
読み取り中…
検索中…
一致する文字列を見つけられません
PadPS5.hpp
[詳解]
1//
2// 通信用メッセージ
3//
4// Copyright (c) 2022-2024 udonrobo
5//
6
7#pragma once
8
10
11#include <stdint.h>
12
13namespace Udon
14{
15 namespace Message
16 {
17
20 struct PadPS5
21 {
22 bool isConnected; // 接続状態
23
24 bool triangle; // ▵
25 bool circle; // ○
26 bool cross; // ×
27 bool square; // □
28
29 bool up; // ↑
30 bool right; // →
31 bool down; // ↓
32 bool left; // ←
33
34 bool l1;
35 bool r1;
36
37 bool l2;
38 bool r2;
39
40 bool l3; // 左スティック押し込み
41 bool r3; // 右スティック押し込み
42
43 bool create; // 左上 \|/ ボタン
44 bool option; // 右上 ≡ ボタン
45
46 bool touch; // タッチパッド
47
48 bool mic; // ミュートボタン
49 bool ps; // PSボタン
50
53
56
57 void clear()
58 {
59 *this = {};
60 }
61
62#ifdef ARDUINO
64 void show() const
65 {
66 if (isConnected)
67 {
68 Serial.print("connected ");
69 }
70 else
71 {
72 Serial.print("disconnected ");
73 }
74
75 Serial.print(triangle), Serial.print(' ');
76 Serial.print(circle), Serial.print(' ');
77 Serial.print(cross), Serial.print(' ');
78 Serial.print(square), Serial.print(' ');
79
80 Serial.print(up), Serial.print(' ');
81 Serial.print(right), Serial.print(' ');
82 Serial.print(down), Serial.print(' ');
83 Serial.print(left), Serial.print(' ');
84
85 Serial.print(l1), Serial.print(' ');
86 Serial.print(r1), Serial.print(' ');
87 Serial.print(l2), Serial.print(' ');
88 Serial.print(r2), Serial.print(' ');
89 Serial.print(l3), Serial.print(' ');
90 Serial.print(r3), Serial.print(' ');
91
92 Serial.print(create), Serial.print(' ');
93 Serial.print(option), Serial.print(' ');
94 Serial.print(touch), Serial.print(' ');
95 Serial.print(mic), Serial.print(' ');
96 Serial.print(ps), Serial.print(' ');
97
98 Serial.print(analogRightX), Serial.print('\t');
99 Serial.print(analogRightY), Serial.print('\t');
100 Serial.print(analogLeftX), Serial.print('\t');
101 Serial.print(analogLeftY);
102 }
103#endif
104
108 up, right, down, left,
109 l1, r1, l2, r2, l3, r3,
112 };
113 } // namespace Message
114} // namespace Udon
Definition Bit.hpp:12
PS5コントローラーのボタン情報
Definition PadPS5.hpp:21
bool cross
Definition PadPS5.hpp:26
void clear()
Definition PadPS5.hpp:57
int8_t analogRightX
Definition PadPS5.hpp:51
bool r2
Definition PadPS5.hpp:38
bool isConnected
Definition PadPS5.hpp:22
bool l2
Definition PadPS5.hpp:37
bool r3
Definition PadPS5.hpp:41
bool right
Definition PadPS5.hpp:30
bool down
Definition PadPS5.hpp:31
int8_t analogLeftY
Definition PadPS5.hpp:55
bool triangle
Definition PadPS5.hpp:24
bool square
Definition PadPS5.hpp:27
bool touch
Definition PadPS5.hpp:46
bool ps
Definition PadPS5.hpp:49
bool circle
Definition PadPS5.hpp:25
bool option
Definition PadPS5.hpp:44
bool l1
Definition PadPS5.hpp:34
bool left
Definition PadPS5.hpp:32
int8_t analogLeftX
Definition PadPS5.hpp:54
bool l3
Definition PadPS5.hpp:40
UDON_ENUMERABLE(isConnected, triangle, circle, cross, square, up, right, down, left, l1, r1, l2, r2, l3, r3, create, option, touch, mic, ps, analogRightX, analogRightY, analogLeftX, analogLeftY)
bool create
Definition PadPS5.hpp:43
bool r1
Definition PadPS5.hpp:35
bool mic
Definition PadPS5.hpp:48
bool up
Definition PadPS5.hpp:29
int8_t analogRightY
Definition PadPS5.hpp:52