質問編集履歴
1
誤字修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
|
17
|
+
下記に自作リンバッファのプログラムを載せておきます.プログラムが汚くてすみません,試作中なので,コメントアウト等が多くあります.間違い等ありましたら指摘お願いします.
|
18
18
|
|
19
19
|
|
20
20
|
|
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
-
volatile char getData__[
|
41
|
+
volatile char getData__[256] = {0};
|
42
42
|
|
43
43
|
volatile int writePos__ = 0;
|
44
44
|
|
@@ -70,7 +70,7 @@
|
|
70
70
|
|
71
71
|
midi.attach(Midi_RX_, RawSerial::RxIrq);
|
72
72
|
|
73
|
-
//省略
|
73
|
+
//省略
|
74
74
|
|
75
75
|
}
|
76
76
|
|
@@ -166,93 +166,7 @@
|
|
166
166
|
|
167
167
|
|
168
168
|
|
169
|
-
/*int getData()
|
170
|
-
|
171
|
-
{
|
172
|
-
|
173
|
-
while (!midi.readable()) {}
|
174
|
-
|
175
|
-
return midi.getc();
|
176
|
-
|
177
|
-
|
169
|
+
//省略
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
void LEDwrite()
|
182
|
-
|
183
|
-
{
|
184
|
-
|
185
|
-
if (flag_uk == true) {
|
186
|
-
|
187
|
-
for (int i = 0; i < 12; i++) {
|
188
|
-
|
189
|
-
if (LEDlight_uk[i] == true) for (int j = i * 5; j < (i + 1) * 5; j++) uk_px.Set(j,0x0000ff);
|
190
|
-
|
191
|
-
else for (int j = i * 5; j < (i + 1) * 5; j++) uk_px.Set(j,0x000000);
|
192
|
-
|
193
|
-
}
|
194
|
-
|
195
|
-
uk.write(uk_px.getBuf());
|
196
|
-
|
197
|
-
flag_uk = false;
|
198
|
-
|
199
|
-
}
|
200
|
-
|
201
|
-
if (flag_lk == true) {
|
202
|
-
|
203
|
-
for (int i = 0; i < 12; i++) {
|
204
|
-
|
205
|
-
if (LEDlight_lk[i] == true) for (int j = i * 5; j < (i + 1) * 5; j++)lk_px.Set(j,0x00ff00);
|
206
|
-
|
207
|
-
else for (int j = i * 5; j < (i + 1) * 5; j++) lk_px.Set(j,0x000000);
|
208
|
-
|
209
|
-
}
|
210
|
-
|
211
|
-
lk.write(lk_px.getBuf());
|
212
|
-
|
213
|
-
flag_lk = false;
|
214
|
-
|
215
|
-
}
|
216
|
-
|
217
|
-
if (flag_pk == true) {
|
218
|
-
|
219
|
-
for (int i = 0; i < 12; i++) {
|
220
|
-
|
221
|
-
if (LEDlight_pk[i] == true) for (int j = i * 2; j < (i + 1) * 2; j++) pk_px.Set(j,0xff0000);
|
222
|
-
|
223
|
-
else for (int j = i * 2; j < (i + 1) * 2; j++) pk_px.Set(j,0x000000);
|
224
|
-
|
225
|
-
}
|
226
|
-
|
227
|
-
pk.write(pk_px.getBuf());
|
228
|
-
|
229
|
-
flag_pk = false;
|
230
|
-
|
231
|
-
}
|
232
|
-
|
233
|
-
}
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
void Model_request()
|
238
|
-
|
239
|
-
{
|
240
|
-
|
241
|
-
char send_data[6] = {0xF0,0x43,0x70,0x70,0x30,0xF7};
|
242
|
-
|
243
|
-
write_(send_data,6);
|
244
|
-
|
245
|
-
}
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
int map(int x, int in_min, int in_max, int out_min, int out_max)
|
250
|
-
|
251
|
-
{
|
252
|
-
|
253
|
-
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
254
|
-
|
255
|
-
}
|
256
170
|
|
257
171
|
|
258
172
|
|