質問編集履歴
1
書き終わる前に投稿してしまいました
test
CHANGED
File without changes
|
test
CHANGED
@@ -76,4 +76,96 @@
|
|
76
76
|
|
77
77
|
###試したこと
|
78
78
|
|
79
|
+
|
80
|
+
|
79
|
-
######
|
81
|
+
######直接指定してみる
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
```Arduino
|
86
|
+
|
87
|
+
const int Array1[] PROGMEM = {1, 2};
|
88
|
+
|
89
|
+
const int Array2[] PROGMEM = {4, 8};
|
90
|
+
|
91
|
+
const int Array3[] PROGMEM = {16, 32};
|
92
|
+
|
93
|
+
const int Array4[] PROGMEM = {64, 128};
|
94
|
+
|
95
|
+
int *const Length[] PROGMEM = {Array1, Array2, Array3, Array4};
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
int const Length1[][2] PROGMEM = {
|
100
|
+
|
101
|
+
{1, 2},
|
102
|
+
|
103
|
+
{4, 8},
|
104
|
+
|
105
|
+
{16, 32},
|
106
|
+
|
107
|
+
{64, 128}
|
108
|
+
|
109
|
+
};
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
void setup() {
|
114
|
+
|
115
|
+
Serial.begin(9600);
|
116
|
+
|
117
|
+
}
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
void loop() {
|
122
|
+
|
123
|
+
Serial.println(pgm_read_byte(&(Length[0][0])));
|
124
|
+
|
125
|
+
Serial.println(pgm_read_byte(&(Length[0][1])));
|
126
|
+
|
127
|
+
Serial.println(pgm_read_byte(&(Length[1][0])));
|
128
|
+
|
129
|
+
Serial.println(pgm_read_byte(&(Length[1][1])));
|
130
|
+
|
131
|
+
Serial.println(pgm_read_byte(&(Length[2][0])));
|
132
|
+
|
133
|
+
Serial.println(pgm_read_byte(&(Length[2][1])));
|
134
|
+
|
135
|
+
Serial.println(pgm_read_byte(&(Length[3][0])));
|
136
|
+
|
137
|
+
Serial.println(pgm_read_byte(&(Length[3][1])));
|
138
|
+
|
139
|
+
while (1);
|
140
|
+
|
141
|
+
}
|
142
|
+
|
143
|
+
```
|
144
|
+
|
145
|
+
```Text
|
146
|
+
|
147
|
+
1
|
148
|
+
|
149
|
+
2
|
150
|
+
|
151
|
+
4
|
152
|
+
|
153
|
+
8
|
154
|
+
|
155
|
+
16
|
156
|
+
|
157
|
+
32
|
158
|
+
|
159
|
+
64
|
160
|
+
|
161
|
+
128//これだとうまくいくのはなぜなのか
|
162
|
+
|
163
|
+
```
|
164
|
+
|
165
|
+
###補足情報
|
166
|
+
|
167
|
+
Arduino 1.8.13
|
168
|
+
|
169
|
+
Arduino Uno を使っています。
|
170
|
+
|
171
|
+
よろしくお願いします。
|