![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Read EEPROM Program for OB2021
Dependencies: mbed EEPROM_lib
main.cpp@0:a74bb96348b9, 2021-08-08 (annotated)
- Committer:
- imadaemi
- Date:
- Sun Aug 08 11:30:32 2021 +0000
- Revision:
- 0:a74bb96348b9
v1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
imadaemi | 0:a74bb96348b9 | 1 | #include "mbed.h" |
imadaemi | 0:a74bb96348b9 | 2 | #include "EEPROM_lib.h" |
imadaemi | 0:a74bb96348b9 | 3 | |
imadaemi | 0:a74bb96348b9 | 4 | // *************************************************** |
imadaemi | 0:a74bb96348b9 | 5 | // コンストラクタ |
imadaemi | 0:a74bb96348b9 | 6 | // *************************************************** |
imadaemi | 0:a74bb96348b9 | 7 | Serial pc(USBTX, USBRX, 230400); |
imadaemi | 0:a74bb96348b9 | 8 | I2C i2c_bus(p28, p27); |
imadaemi | 0:a74bb96348b9 | 9 | |
imadaemi | 0:a74bb96348b9 | 10 | EEPROM_lib EEPROM(i2c_bus, 4); |
imadaemi | 0:a74bb96348b9 | 11 | |
imadaemi | 0:a74bb96348b9 | 12 | DigitalOut pinA(p21); |
imadaemi | 0:a74bb96348b9 | 13 | DigitalOut pinB(p22); |
imadaemi | 0:a74bb96348b9 | 14 | DigitalOut pinC(p23); |
imadaemi | 0:a74bb96348b9 | 15 | |
imadaemi | 0:a74bb96348b9 | 16 | // *************************************************** |
imadaemi | 0:a74bb96348b9 | 17 | // 関数の宣言 |
imadaemi | 0:a74bb96348b9 | 18 | // *************************************************** |
imadaemi | 0:a74bb96348b9 | 19 | void setEEPROMGroup(int group_num); |
imadaemi | 0:a74bb96348b9 | 20 | |
imadaemi | 0:a74bb96348b9 | 21 | // *************************************************** |
imadaemi | 0:a74bb96348b9 | 22 | // メイン関数 |
imadaemi | 0:a74bb96348b9 | 23 | // *************************************************** |
imadaemi | 0:a74bb96348b9 | 24 | int main() { |
imadaemi | 0:a74bb96348b9 | 25 | pc.printf("Please Input '7' to Start Progeam\r\n"); |
imadaemi | 0:a74bb96348b9 | 26 | |
imadaemi | 0:a74bb96348b9 | 27 | while(1) { |
imadaemi | 0:a74bb96348b9 | 28 | if(pc.readable()){ |
imadaemi | 0:a74bb96348b9 | 29 | int c = pc.getc(); |
imadaemi | 0:a74bb96348b9 | 30 | pc.printf("Input: %c\r\n", c); |
imadaemi | 0:a74bb96348b9 | 31 | if(c == '7'){ |
imadaemi | 0:a74bb96348b9 | 32 | break; |
imadaemi | 0:a74bb96348b9 | 33 | } |
imadaemi | 0:a74bb96348b9 | 34 | } |
imadaemi | 0:a74bb96348b9 | 35 | } |
imadaemi | 0:a74bb96348b9 | 36 | |
imadaemi | 0:a74bb96348b9 | 37 | /* |
imadaemi | 0:a74bb96348b9 | 38 | int ptr; |
imadaemi | 0:a74bb96348b9 | 39 | float n = 0; |
imadaemi | 0:a74bb96348b9 | 40 | int eeprom_ptr = 0; |
imadaemi | 0:a74bb96348b9 | 41 | */ |
imadaemi | 0:a74bb96348b9 | 42 | |
imadaemi | 0:a74bb96348b9 | 43 | char data[128]; |
imadaemi | 0:a74bb96348b9 | 44 | int num, block; |
imadaemi | 0:a74bb96348b9 | 45 | char ADDR_H, ADDR_L; |
imadaemi | 0:a74bb96348b9 | 46 | |
imadaemi | 0:a74bb96348b9 | 47 | num = 1; |
imadaemi | 0:a74bb96348b9 | 48 | //block = 0; |
imadaemi | 0:a74bb96348b9 | 49 | //ADDR_H = ADDR_L = 0x00; |
imadaemi | 0:a74bb96348b9 | 50 | |
imadaemi | 0:a74bb96348b9 | 51 | //setEEPROMGroup(0); |
imadaemi | 0:a74bb96348b9 | 52 | for(int j = 0; j < 4; j ++){ |
imadaemi | 0:a74bb96348b9 | 53 | pc.printf("Start to read %d EEPROM\r\n",j); |
imadaemi | 0:a74bb96348b9 | 54 | |
imadaemi | 0:a74bb96348b9 | 55 | setEEPROMGroup(j); |
imadaemi | 0:a74bb96348b9 | 56 | num = 1; |
imadaemi | 0:a74bb96348b9 | 57 | block = 0; |
imadaemi | 0:a74bb96348b9 | 58 | ADDR_H = ADDR_L = 0x00; |
imadaemi | 0:a74bb96348b9 | 59 | |
imadaemi | 0:a74bb96348b9 | 60 | for(int i = 0; i < 4096; i ++){ |
imadaemi | 0:a74bb96348b9 | 61 | switch(i){ |
imadaemi | 0:a74bb96348b9 | 62 | case 512: |
imadaemi | 0:a74bb96348b9 | 63 | num = 1; |
imadaemi | 0:a74bb96348b9 | 64 | block = 1; |
imadaemi | 0:a74bb96348b9 | 65 | /* |
imadaemi | 0:a74bb96348b9 | 66 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 67 | pc.printf("num : %d, block %d\r\n",num,block); |
imadaemi | 0:a74bb96348b9 | 68 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 69 | */ |
imadaemi | 0:a74bb96348b9 | 70 | break; |
imadaemi | 0:a74bb96348b9 | 71 | |
imadaemi | 0:a74bb96348b9 | 72 | case 1024: |
imadaemi | 0:a74bb96348b9 | 73 | num = 2; |
imadaemi | 0:a74bb96348b9 | 74 | block = 0; |
imadaemi | 0:a74bb96348b9 | 75 | /* |
imadaemi | 0:a74bb96348b9 | 76 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 77 | pc.printf("num : %d, block %d\r\n",num,block); |
imadaemi | 0:a74bb96348b9 | 78 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 79 | */ |
imadaemi | 0:a74bb96348b9 | 80 | break; |
imadaemi | 0:a74bb96348b9 | 81 | |
imadaemi | 0:a74bb96348b9 | 82 | case 1536: |
imadaemi | 0:a74bb96348b9 | 83 | num = 2; |
imadaemi | 0:a74bb96348b9 | 84 | block = 1; |
imadaemi | 0:a74bb96348b9 | 85 | /* |
imadaemi | 0:a74bb96348b9 | 86 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 87 | pc.printf("num : %d, block %d\r\n",num,block); |
imadaemi | 0:a74bb96348b9 | 88 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 89 | */ |
imadaemi | 0:a74bb96348b9 | 90 | break; |
imadaemi | 0:a74bb96348b9 | 91 | |
imadaemi | 0:a74bb96348b9 | 92 | case 2048: |
imadaemi | 0:a74bb96348b9 | 93 | num = 3; |
imadaemi | 0:a74bb96348b9 | 94 | block = 0; |
imadaemi | 0:a74bb96348b9 | 95 | /* |
imadaemi | 0:a74bb96348b9 | 96 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 97 | pc.printf("num : %d, block %d\r\n",num,block); |
imadaemi | 0:a74bb96348b9 | 98 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 99 | */ |
imadaemi | 0:a74bb96348b9 | 100 | break; |
imadaemi | 0:a74bb96348b9 | 101 | |
imadaemi | 0:a74bb96348b9 | 102 | case 2560: |
imadaemi | 0:a74bb96348b9 | 103 | num = 3; |
imadaemi | 0:a74bb96348b9 | 104 | block = 1; |
imadaemi | 0:a74bb96348b9 | 105 | /* |
imadaemi | 0:a74bb96348b9 | 106 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 107 | pc.printf("num : %d, block %d\r\n",num,block); |
imadaemi | 0:a74bb96348b9 | 108 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 109 | */ |
imadaemi | 0:a74bb96348b9 | 110 | break; |
imadaemi | 0:a74bb96348b9 | 111 | |
imadaemi | 0:a74bb96348b9 | 112 | case 3072: |
imadaemi | 0:a74bb96348b9 | 113 | num = 4; |
imadaemi | 0:a74bb96348b9 | 114 | block = 0; |
imadaemi | 0:a74bb96348b9 | 115 | /* |
imadaemi | 0:a74bb96348b9 | 116 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 117 | pc.printf("num : %d, block %d\r\n",num,block); |
imadaemi | 0:a74bb96348b9 | 118 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 119 | */ |
imadaemi | 0:a74bb96348b9 | 120 | break; |
imadaemi | 0:a74bb96348b9 | 121 | |
imadaemi | 0:a74bb96348b9 | 122 | case 3584: |
imadaemi | 0:a74bb96348b9 | 123 | num = 4; |
imadaemi | 0:a74bb96348b9 | 124 | block = 1; |
imadaemi | 0:a74bb96348b9 | 125 | /* |
imadaemi | 0:a74bb96348b9 | 126 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 127 | pc.printf("num : %d, block %d\r\n",num,block); |
imadaemi | 0:a74bb96348b9 | 128 | pc.printf("********************\r\n"); |
imadaemi | 0:a74bb96348b9 | 129 | */ |
imadaemi | 0:a74bb96348b9 | 130 | break; |
imadaemi | 0:a74bb96348b9 | 131 | |
imadaemi | 0:a74bb96348b9 | 132 | } |
imadaemi | 0:a74bb96348b9 | 133 | |
imadaemi | 0:a74bb96348b9 | 134 | EEPROM.readMultiByte(num, block, ADDR_H, ADDR_L, data, 128); |
imadaemi | 0:a74bb96348b9 | 135 | /* |
imadaemi | 0:a74bb96348b9 | 136 | for(int x = 0; x < 128; x ++){ |
imadaemi | 0:a74bb96348b9 | 137 | pc.printf("%02x ", data[x]); |
imadaemi | 0:a74bb96348b9 | 138 | } |
imadaemi | 0:a74bb96348b9 | 139 | pc.printf("\r\n"); |
imadaemi | 0:a74bb96348b9 | 140 | */ |
imadaemi | 0:a74bb96348b9 | 141 | int eep_buf = 0; |
imadaemi | 0:a74bb96348b9 | 142 | |
imadaemi | 0:a74bb96348b9 | 143 | float eep_data_f; |
imadaemi | 0:a74bb96348b9 | 144 | int eep_data_i; |
imadaemi | 0:a74bb96348b9 | 145 | char eep_data_c; |
imadaemi | 0:a74bb96348b9 | 146 | |
imadaemi | 0:a74bb96348b9 | 147 | eep_data_c = *reinterpret_cast<char*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 148 | eep_buf += 1; |
imadaemi | 0:a74bb96348b9 | 149 | pc.printf("%d ", eep_data_c); |
imadaemi | 0:a74bb96348b9 | 150 | |
imadaemi | 0:a74bb96348b9 | 151 | eep_data_i = *reinterpret_cast<int*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 152 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 153 | pc.printf("%d ", eep_data_i); |
imadaemi | 0:a74bb96348b9 | 154 | |
imadaemi | 0:a74bb96348b9 | 155 | //eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 156 | //eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 157 | //pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 158 | |
imadaemi | 0:a74bb96348b9 | 159 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 160 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 161 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 162 | |
imadaemi | 0:a74bb96348b9 | 163 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 164 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 165 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 166 | |
imadaemi | 0:a74bb96348b9 | 167 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 168 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 169 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 170 | |
imadaemi | 0:a74bb96348b9 | 171 | eep_data_c = *reinterpret_cast<char*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 172 | eep_buf += 1; |
imadaemi | 0:a74bb96348b9 | 173 | pc.printf("%d ", eep_data_c); |
imadaemi | 0:a74bb96348b9 | 174 | |
imadaemi | 0:a74bb96348b9 | 175 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 176 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 177 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 178 | |
imadaemi | 0:a74bb96348b9 | 179 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 180 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 181 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 182 | |
imadaemi | 0:a74bb96348b9 | 183 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 184 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 185 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 186 | |
imadaemi | 0:a74bb96348b9 | 187 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 188 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 189 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 190 | |
imadaemi | 0:a74bb96348b9 | 191 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 192 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 193 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 194 | |
imadaemi | 0:a74bb96348b9 | 195 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 196 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 197 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 198 | |
imadaemi | 0:a74bb96348b9 | 199 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 200 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 201 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 202 | |
imadaemi | 0:a74bb96348b9 | 203 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 204 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 205 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 206 | |
imadaemi | 0:a74bb96348b9 | 207 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 208 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 209 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 210 | |
imadaemi | 0:a74bb96348b9 | 211 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 212 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 213 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 214 | |
imadaemi | 0:a74bb96348b9 | 215 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 216 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 217 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 218 | |
imadaemi | 0:a74bb96348b9 | 219 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 220 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 221 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 222 | |
imadaemi | 0:a74bb96348b9 | 223 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 224 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 225 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 226 | |
imadaemi | 0:a74bb96348b9 | 227 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 228 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 229 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 230 | |
imadaemi | 0:a74bb96348b9 | 231 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 232 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 233 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 234 | |
imadaemi | 0:a74bb96348b9 | 235 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 236 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 237 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 238 | |
imadaemi | 0:a74bb96348b9 | 239 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 240 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 241 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 242 | |
imadaemi | 0:a74bb96348b9 | 243 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 244 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 245 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 246 | |
imadaemi | 0:a74bb96348b9 | 247 | eep_data_f = *reinterpret_cast<float*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 248 | eep_buf += 4; |
imadaemi | 0:a74bb96348b9 | 249 | pc.printf("%f ", eep_data_f); |
imadaemi | 0:a74bb96348b9 | 250 | |
imadaemi | 0:a74bb96348b9 | 251 | eep_data_c = *reinterpret_cast<char*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 252 | eep_buf += 1; |
imadaemi | 0:a74bb96348b9 | 253 | pc.printf("%d ", eep_data_c); |
imadaemi | 0:a74bb96348b9 | 254 | |
imadaemi | 0:a74bb96348b9 | 255 | eep_data_c = *reinterpret_cast<char*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 256 | eep_buf += 1; |
imadaemi | 0:a74bb96348b9 | 257 | pc.printf("%d ", eep_data_c); |
imadaemi | 0:a74bb96348b9 | 258 | |
imadaemi | 0:a74bb96348b9 | 259 | eep_data_c = *reinterpret_cast<char*>(&data[eep_buf]); |
imadaemi | 0:a74bb96348b9 | 260 | eep_buf += 1; |
imadaemi | 0:a74bb96348b9 | 261 | pc.printf("%d ", eep_data_c); |
imadaemi | 0:a74bb96348b9 | 262 | |
imadaemi | 0:a74bb96348b9 | 263 | pc.printf("\r\n"); |
imadaemi | 0:a74bb96348b9 | 264 | |
imadaemi | 0:a74bb96348b9 | 265 | if(ADDR_L == 0x00){ |
imadaemi | 0:a74bb96348b9 | 266 | ADDR_L = 0x80; |
imadaemi | 0:a74bb96348b9 | 267 | } |
imadaemi | 0:a74bb96348b9 | 268 | else{ |
imadaemi | 0:a74bb96348b9 | 269 | ADDR_L = 0x00; |
imadaemi | 0:a74bb96348b9 | 270 | ADDR_H ++; |
imadaemi | 0:a74bb96348b9 | 271 | } |
imadaemi | 0:a74bb96348b9 | 272 | } |
imadaemi | 0:a74bb96348b9 | 273 | } |
imadaemi | 0:a74bb96348b9 | 274 | } |
imadaemi | 0:a74bb96348b9 | 275 | |
imadaemi | 0:a74bb96348b9 | 276 | // *************************************************** |
imadaemi | 0:a74bb96348b9 | 277 | // マルチプレクサで使うEEPROMを変更する |
imadaemi | 0:a74bb96348b9 | 278 | // *************************************************** |
imadaemi | 0:a74bb96348b9 | 279 | void setEEPROMGroup(int group_num){ |
imadaemi | 0:a74bb96348b9 | 280 | switch(group_num){ |
imadaemi | 0:a74bb96348b9 | 281 | case 0: |
imadaemi | 0:a74bb96348b9 | 282 | pinA = 0; |
imadaemi | 0:a74bb96348b9 | 283 | pinB = 0; |
imadaemi | 0:a74bb96348b9 | 284 | pinC = 0; |
imadaemi | 0:a74bb96348b9 | 285 | break; |
imadaemi | 0:a74bb96348b9 | 286 | |
imadaemi | 0:a74bb96348b9 | 287 | case 1: |
imadaemi | 0:a74bb96348b9 | 288 | pinA = 1; |
imadaemi | 0:a74bb96348b9 | 289 | pinB = 0; |
imadaemi | 0:a74bb96348b9 | 290 | pinC = 0; |
imadaemi | 0:a74bb96348b9 | 291 | break; |
imadaemi | 0:a74bb96348b9 | 292 | |
imadaemi | 0:a74bb96348b9 | 293 | case 2: |
imadaemi | 0:a74bb96348b9 | 294 | pinA = 0; |
imadaemi | 0:a74bb96348b9 | 295 | pinB = 1; |
imadaemi | 0:a74bb96348b9 | 296 | pinC = 0; |
imadaemi | 0:a74bb96348b9 | 297 | break; |
imadaemi | 0:a74bb96348b9 | 298 | |
imadaemi | 0:a74bb96348b9 | 299 | case 3: |
imadaemi | 0:a74bb96348b9 | 300 | pinA = 1; |
imadaemi | 0:a74bb96348b9 | 301 | pinB = 1; |
imadaemi | 0:a74bb96348b9 | 302 | pinC = 0; |
imadaemi | 0:a74bb96348b9 | 303 | break; |
imadaemi | 0:a74bb96348b9 | 304 | } |
imadaemi | 0:a74bb96348b9 | 305 | } |
imadaemi | 0:a74bb96348b9 | 306 |