for jorge
Dependencies: MMA8451Q mbed nRF24L01P
Fork of nRF24L01P_Hello_World by
main.cpp@2:020a3715aac4, 2017-03-14 (annotated)
- Committer:
- supershiu
- Date:
- Tue Mar 14 19:36:33 2017 +0000
- Revision:
- 2:020a3715aac4
- Parent:
- 1:5be2682710c6
for jorge
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Owen | 0:a51a6e7da590 | 1 | #include "mbed.h" |
supershiu | 2:020a3715aac4 | 2 | #include "MMA8451Q.h" |
Owen | 0:a51a6e7da590 | 3 | #include "nRF24L01P.h" |
supershiu | 2:020a3715aac4 | 4 | #include <string> |
Owen | 0:a51a6e7da590 | 5 | |
supershiu | 2:020a3715aac4 | 6 | #define MMA8451_I2C_ADDRESS (0x1d<<1) |
supershiu | 2:020a3715aac4 | 7 | #define TRANSFER_SIZE 1 |
Owen | 0:a51a6e7da590 | 8 | |
supershiu | 2:020a3715aac4 | 9 | nRF24L01P my_nrf24l01p(PTD2, PTD3, PTC5, PTA4, PTC8, PTA12); // mosi, miso, sck, csn, ce, irq |
supershiu | 2:020a3715aac4 | 10 | DigitalOut tx(PTD5); |
supershiu | 2:020a3715aac4 | 11 | DigitalOut rx(PTA13); |
supershiu | 2:020a3715aac4 | 12 | DigitalIn press(PTB0); |
supershiu | 2:020a3715aac4 | 13 | |
Owen | 0:a51a6e7da590 | 14 | |
supershiu | 2:020a3715aac4 | 15 | int funcx(float y); //Function to dtermine angle |
supershiu | 2:020a3715aac4 | 16 | string funcp(int, char); |
supershiu | 2:020a3715aac4 | 17 | string funcp(int p, char c); |
supershiu | 2:020a3715aac4 | 18 | Serial pc(USBTX, USBRX); |
Owen | 0:a51a6e7da590 | 19 | |
supershiu | 2:020a3715aac4 | 20 | float Y; |
supershiu | 2:020a3715aac4 | 21 | int x; |
supershiu | 2:020a3715aac4 | 22 | string z; |
supershiu | 2:020a3715aac4 | 23 | float p; |
supershiu | 2:020a3715aac4 | 24 | |
Owen | 0:a51a6e7da590 | 25 | |
supershiu | 2:020a3715aac4 | 26 | int main(){ |
supershiu | 2:020a3715aac4 | 27 | MMA8451Q acc(PTE25, PTE24, MMA8451_I2C_ADDRESS); |
supershiu | 2:020a3715aac4 | 28 | char rxData[TRANSFER_SIZE]; |
supershiu | 2:020a3715aac4 | 29 | int rxDataCnt = 0; |
supershiu | 2:020a3715aac4 | 30 | my_nrf24l01p.powerUp(); |
Owen | 0:a51a6e7da590 | 31 | my_nrf24l01p.setTransferSize( TRANSFER_SIZE ); |
Owen | 0:a51a6e7da590 | 32 | my_nrf24l01p.setReceiveMode(); |
Owen | 0:a51a6e7da590 | 33 | my_nrf24l01p.enable(); |
supershiu | 2:020a3715aac4 | 34 | pc.printf("receiver\n"); |
Owen | 0:a51a6e7da590 | 35 | |
supershiu | 2:020a3715aac4 | 36 | |
supershiu | 2:020a3715aac4 | 37 | while (1){ |
supershiu | 2:020a3715aac4 | 38 | p = press.read(); |
supershiu | 2:020a3715aac4 | 39 | Y = abs(acc.getAccY()); //Get gyroscope readings |
supershiu | 2:020a3715aac4 | 40 | x =funcx(Y); //Call function to determine angle based on gyroscoe readings |
supershiu | 2:020a3715aac4 | 41 | |
supershiu | 2:020a3715aac4 | 42 | if (p && my_nrf24l01p.readable()){//transmitter not sending signal when open string. |
supershiu | 2:020a3715aac4 | 43 | //if (my_nrf24l01p.readable()){ |
supershiu | 2:020a3715aac4 | 44 | rxDataCnt = my_nrf24l01p.read( NRF24L01P_PIPE_P0, rxData, sizeof( rxData ) ); |
supershiu | 2:020a3715aac4 | 45 | for ( int i = 0; rxDataCnt > 0; rxDataCnt--, i++ ){ |
supershiu | 2:020a3715aac4 | 46 | //pc.putc( rxData[i] ); |
supershiu | 2:020a3715aac4 | 47 | z = funcp(x, rxData[i]); |
supershiu | 2:020a3715aac4 | 48 | pc.printf("%s\n", z); |
supershiu | 2:020a3715aac4 | 49 | } |
supershiu | 2:020a3715aac4 | 50 | rx = !rx; |
supershiu | 2:020a3715aac4 | 51 | } |
supershiu | 2:020a3715aac4 | 52 | |
supershiu | 2:020a3715aac4 | 53 | //z=funcp(x,rxData[i]); what is this????????????????????????????????????????????????????????????????????? |
supershiu | 2:020a3715aac4 | 54 | |
supershiu | 2:020a3715aac4 | 55 | } |
supershiu | 2:020a3715aac4 | 56 | } |
Owen | 0:a51a6e7da590 | 57 | |
supershiu | 2:020a3715aac4 | 58 | //Function used to determine the angle for note |
supershiu | 2:020a3715aac4 | 59 | int funcx(float y){ |
supershiu | 2:020a3715aac4 | 60 | int a; |
supershiu | 2:020a3715aac4 | 61 | if (y < 0.25000) |
supershiu | 2:020a3715aac4 | 62 | { |
supershiu | 2:020a3715aac4 | 63 | a=1; |
supershiu | 2:020a3715aac4 | 64 | } |
supershiu | 2:020a3715aac4 | 65 | else if (y > 0.25001 && y < 0.5000) |
supershiu | 2:020a3715aac4 | 66 | { |
supershiu | 2:020a3715aac4 | 67 | a=2; |
supershiu | 2:020a3715aac4 | 68 | } |
supershiu | 2:020a3715aac4 | 69 | else if (y > 0.50001 && y < 0.7500) |
supershiu | 2:020a3715aac4 | 70 | { |
supershiu | 2:020a3715aac4 | 71 | a=3; |
supershiu | 2:020a3715aac4 | 72 | } |
supershiu | 2:020a3715aac4 | 73 | else |
supershiu | 2:020a3715aac4 | 74 | { |
supershiu | 2:020a3715aac4 | 75 | a=4; |
supershiu | 2:020a3715aac4 | 76 | } |
supershiu | 2:020a3715aac4 | 77 | //pc.printf("%i ",a); |
supershiu | 2:020a3715aac4 | 78 | return a; |
supershiu | 2:020a3715aac4 | 79 | } |
Owen | 0:a51a6e7da590 | 80 | |
supershiu | 2:020a3715aac4 | 81 | //Final function used to dtermine what string to send to the phone// |
supershiu | 2:020a3715aac4 | 82 | string funcp(int p, char c){ |
supershiu | 2:020a3715aac4 | 83 | string str; // Final string output |
supershiu | 2:020a3715aac4 | 84 | |
supershiu | 2:020a3715aac4 | 85 | if(p == 1) |
supershiu | 2:020a3715aac4 | 86 | { |
supershiu | 2:020a3715aac4 | 87 | if(c == 'r') |
supershiu | 2:020a3715aac4 | 88 | { |
supershiu | 2:020a3715aac4 | 89 | str = "G string D flat"; |
supershiu | 2:020a3715aac4 | 90 | //return str; |
supershiu | 2:020a3715aac4 | 91 | } |
supershiu | 2:020a3715aac4 | 92 | if(c == 'e') |
supershiu | 2:020a3715aac4 | 93 | { |
supershiu | 2:020a3715aac4 | 94 | str = "G string C flat"; |
supershiu | 2:020a3715aac4 | 95 | //return str; |
supershiu | 2:020a3715aac4 | 96 | } |
supershiu | 2:020a3715aac4 | 97 | if(c == 'w') |
supershiu | 2:020a3715aac4 | 98 | { |
supershiu | 2:020a3715aac4 | 99 | str = "G string B flat"; |
supershiu | 2:020a3715aac4 | 100 | //return str; |
supershiu | 2:020a3715aac4 | 101 | } |
supershiu | 2:020a3715aac4 | 102 | if(c == 'q') |
supershiu | 2:020a3715aac4 | 103 | { |
supershiu | 2:020a3715aac4 | 104 | str = "G string A flat"; |
supershiu | 2:020a3715aac4 | 105 | //return str; |
supershiu | 2:020a3715aac4 | 106 | } |
supershiu | 2:020a3715aac4 | 107 | if(c == 'f') |
supershiu | 2:020a3715aac4 | 108 | { |
supershiu | 2:020a3715aac4 | 109 | str = "G string D"; |
supershiu | 2:020a3715aac4 | 110 | //return str; |
supershiu | 2:020a3715aac4 | 111 | } |
supershiu | 2:020a3715aac4 | 112 | if(c == 'd') |
supershiu | 2:020a3715aac4 | 113 | { |
supershiu | 2:020a3715aac4 | 114 | str = "G string C"; |
supershiu | 2:020a3715aac4 | 115 | //return str; |
supershiu | 2:020a3715aac4 | 116 | } |
supershiu | 2:020a3715aac4 | 117 | if(c == 's') |
supershiu | 2:020a3715aac4 | 118 | { |
supershiu | 2:020a3715aac4 | 119 | str = "G string B"; |
supershiu | 2:020a3715aac4 | 120 | //return str; |
supershiu | 2:020a3715aac4 | 121 | } |
supershiu | 2:020a3715aac4 | 122 | if(c == 'a') |
supershiu | 2:020a3715aac4 | 123 | { |
supershiu | 2:020a3715aac4 | 124 | str = "G string A"; |
supershiu | 2:020a3715aac4 | 125 | //return str; |
supershiu | 2:020a3715aac4 | 126 | } |
supershiu | 2:020a3715aac4 | 127 | if(c == 'v') |
supershiu | 2:020a3715aac4 | 128 | { |
supershiu | 2:020a3715aac4 | 129 | str = "G string D sharp"; |
supershiu | 2:020a3715aac4 | 130 | //return str; |
supershiu | 2:020a3715aac4 | 131 | } |
supershiu | 2:020a3715aac4 | 132 | if(c == 'c') |
supershiu | 2:020a3715aac4 | 133 | { |
supershiu | 2:020a3715aac4 | 134 | str = "G string C sharp"; |
supershiu | 2:020a3715aac4 | 135 | //return str; |
supershiu | 2:020a3715aac4 | 136 | } |
supershiu | 2:020a3715aac4 | 137 | if(c == 'x') |
supershiu | 2:020a3715aac4 | 138 | { |
supershiu | 2:020a3715aac4 | 139 | str = "G string B sharp"; |
supershiu | 2:020a3715aac4 | 140 | //return str; |
supershiu | 2:020a3715aac4 | 141 | } |
supershiu | 2:020a3715aac4 | 142 | if(c == 'z') |
supershiu | 2:020a3715aac4 | 143 | { |
supershiu | 2:020a3715aac4 | 144 | str = "G string A sharp"; |
supershiu | 2:020a3715aac4 | 145 | //return str; |
supershiu | 2:020a3715aac4 | 146 | } |
supershiu | 2:020a3715aac4 | 147 | if(c == '0') |
supershiu | 2:020a3715aac4 | 148 | { |
supershiu | 2:020a3715aac4 | 149 | str = "Open G string"; |
supershiu | 2:020a3715aac4 | 150 | return str; |
supershiu | 2:020a3715aac4 | 151 | } |
supershiu | 2:020a3715aac4 | 152 | |
supershiu | 2:020a3715aac4 | 153 | } |
supershiu | 2:020a3715aac4 | 154 | if(p == 2) |
supershiu | 2:020a3715aac4 | 155 | { |
supershiu | 2:020a3715aac4 | 156 | str = "Open D"; |
supershiu | 2:020a3715aac4 | 157 | if(c == 'r') |
supershiu | 2:020a3715aac4 | 158 | { |
supershiu | 2:020a3715aac4 | 159 | str = "D string A flat"; |
supershiu | 2:020a3715aac4 | 160 | //return str; |
supershiu | 2:020a3715aac4 | 161 | } |
supershiu | 2:020a3715aac4 | 162 | if(c == 'e') |
supershiu | 2:020a3715aac4 | 163 | { |
supershiu | 2:020a3715aac4 | 164 | str = "D string G flat"; |
supershiu | 2:020a3715aac4 | 165 | //return str; |
supershiu | 2:020a3715aac4 | 166 | } |
supershiu | 2:020a3715aac4 | 167 | if(c == 'w') |
supershiu | 2:020a3715aac4 | 168 | { |
supershiu | 2:020a3715aac4 | 169 | str = "D string F flat"; |
supershiu | 2:020a3715aac4 | 170 | //return str; |
supershiu | 2:020a3715aac4 | 171 | } |
supershiu | 2:020a3715aac4 | 172 | if(c == 'q') |
supershiu | 2:020a3715aac4 | 173 | { |
supershiu | 2:020a3715aac4 | 174 | str = "D string E flat"; |
supershiu | 2:020a3715aac4 | 175 | //return str; |
supershiu | 2:020a3715aac4 | 176 | } |
supershiu | 2:020a3715aac4 | 177 | if(c == 'f') |
supershiu | 2:020a3715aac4 | 178 | { |
supershiu | 2:020a3715aac4 | 179 | str = "D string A"; |
supershiu | 2:020a3715aac4 | 180 | //return str; |
Owen | 0:a51a6e7da590 | 181 | } |
supershiu | 2:020a3715aac4 | 182 | if(c == 'd') |
supershiu | 2:020a3715aac4 | 183 | { |
supershiu | 2:020a3715aac4 | 184 | str = "D string G"; |
supershiu | 2:020a3715aac4 | 185 | //return str; |
supershiu | 2:020a3715aac4 | 186 | } |
supershiu | 2:020a3715aac4 | 187 | if(c == 's') |
supershiu | 2:020a3715aac4 | 188 | { |
supershiu | 2:020a3715aac4 | 189 | str = "D string F"; |
supershiu | 2:020a3715aac4 | 190 | //return str; |
supershiu | 2:020a3715aac4 | 191 | } |
supershiu | 2:020a3715aac4 | 192 | if(c == 'a') |
supershiu | 2:020a3715aac4 | 193 | { |
supershiu | 2:020a3715aac4 | 194 | str = "D string E"; |
supershiu | 2:020a3715aac4 | 195 | //return str; |
supershiu | 2:020a3715aac4 | 196 | } |
supershiu | 2:020a3715aac4 | 197 | if(c == 'v') |
supershiu | 2:020a3715aac4 | 198 | { |
supershiu | 2:020a3715aac4 | 199 | str = "D string A sharp"; |
supershiu | 2:020a3715aac4 | 200 | //return str; |
supershiu | 2:020a3715aac4 | 201 | } |
supershiu | 2:020a3715aac4 | 202 | if(c == 'c') |
supershiu | 2:020a3715aac4 | 203 | { |
supershiu | 2:020a3715aac4 | 204 | str = "D string G sharp"; |
supershiu | 2:020a3715aac4 | 205 | //return str; |
supershiu | 2:020a3715aac4 | 206 | } |
supershiu | 2:020a3715aac4 | 207 | if(c == 'x') |
supershiu | 2:020a3715aac4 | 208 | { |
supershiu | 2:020a3715aac4 | 209 | str = "D string F sharp"; |
supershiu | 2:020a3715aac4 | 210 | //return str; |
supershiu | 2:020a3715aac4 | 211 | } |
supershiu | 2:020a3715aac4 | 212 | if(c == 'z') |
supershiu | 2:020a3715aac4 | 213 | { |
supershiu | 2:020a3715aac4 | 214 | str = "D string E sharp"; |
supershiu | 2:020a3715aac4 | 215 | //return str; |
supershiu | 2:020a3715aac4 | 216 | } |
supershiu | 2:020a3715aac4 | 217 | if(c == '0') |
supershiu | 2:020a3715aac4 | 218 | { |
supershiu | 2:020a3715aac4 | 219 | str = "Open D string"; |
supershiu | 2:020a3715aac4 | 220 | return str; |
supershiu | 2:020a3715aac4 | 221 | } |
supershiu | 2:020a3715aac4 | 222 | } |
supershiu | 2:020a3715aac4 | 223 | if(p == 3) |
supershiu | 2:020a3715aac4 | 224 | { |
supershiu | 2:020a3715aac4 | 225 | str = "Open A"; |
supershiu | 2:020a3715aac4 | 226 | if(c == 'r') |
supershiu | 2:020a3715aac4 | 227 | { |
supershiu | 2:020a3715aac4 | 228 | str = "A string E flat"; |
supershiu | 2:020a3715aac4 | 229 | //return str; |
supershiu | 2:020a3715aac4 | 230 | } |
supershiu | 2:020a3715aac4 | 231 | if(c == 'e') |
supershiu | 2:020a3715aac4 | 232 | { |
supershiu | 2:020a3715aac4 | 233 | str = "A string D flat"; |
supershiu | 2:020a3715aac4 | 234 | //return str; |
supershiu | 2:020a3715aac4 | 235 | } |
supershiu | 2:020a3715aac4 | 236 | if(c == 'w') |
supershiu | 2:020a3715aac4 | 237 | { |
supershiu | 2:020a3715aac4 | 238 | str = "A string C flat"; |
supershiu | 2:020a3715aac4 | 239 | //return str; |
supershiu | 2:020a3715aac4 | 240 | } |
supershiu | 2:020a3715aac4 | 241 | if(c == 'q') |
supershiu | 2:020a3715aac4 | 242 | { |
supershiu | 2:020a3715aac4 | 243 | str = "A string B flat"; |
supershiu | 2:020a3715aac4 | 244 | //return str; |
supershiu | 2:020a3715aac4 | 245 | } |
supershiu | 2:020a3715aac4 | 246 | if(c == 'f') |
supershiu | 2:020a3715aac4 | 247 | { |
supershiu | 2:020a3715aac4 | 248 | str = "A string E"; |
supershiu | 2:020a3715aac4 | 249 | //return str; |
supershiu | 2:020a3715aac4 | 250 | } |
supershiu | 2:020a3715aac4 | 251 | if(c == 'd') |
supershiu | 2:020a3715aac4 | 252 | { |
supershiu | 2:020a3715aac4 | 253 | str = "A string D"; |
supershiu | 2:020a3715aac4 | 254 | //return str; |
supershiu | 2:020a3715aac4 | 255 | } |
supershiu | 2:020a3715aac4 | 256 | if(c == 's') |
supershiu | 2:020a3715aac4 | 257 | { |
supershiu | 2:020a3715aac4 | 258 | str = "A string C"; |
supershiu | 2:020a3715aac4 | 259 | //return str; |
supershiu | 2:020a3715aac4 | 260 | } |
supershiu | 2:020a3715aac4 | 261 | if(c == 'a') |
supershiu | 2:020a3715aac4 | 262 | { |
supershiu | 2:020a3715aac4 | 263 | str = "A string B"; |
supershiu | 2:020a3715aac4 | 264 | //return str; |
supershiu | 2:020a3715aac4 | 265 | } |
supershiu | 2:020a3715aac4 | 266 | if(c == 'v') |
supershiu | 2:020a3715aac4 | 267 | { |
supershiu | 2:020a3715aac4 | 268 | str = "A string E sharp"; |
supershiu | 2:020a3715aac4 | 269 | //return str; |
supershiu | 2:020a3715aac4 | 270 | } |
supershiu | 2:020a3715aac4 | 271 | if(c == 'c') |
supershiu | 2:020a3715aac4 | 272 | { |
supershiu | 2:020a3715aac4 | 273 | str = "A string D sharp"; |
supershiu | 2:020a3715aac4 | 274 | //return str; |
supershiu | 2:020a3715aac4 | 275 | } |
supershiu | 2:020a3715aac4 | 276 | if(c == 'x') |
supershiu | 2:020a3715aac4 | 277 | { |
supershiu | 2:020a3715aac4 | 278 | str = "A string C sharp"; |
supershiu | 2:020a3715aac4 | 279 | //return str; |
supershiu | 2:020a3715aac4 | 280 | } |
supershiu | 2:020a3715aac4 | 281 | if(c == 'z') |
supershiu | 2:020a3715aac4 | 282 | { |
supershiu | 2:020a3715aac4 | 283 | str = "A string B sharp"; |
supershiu | 2:020a3715aac4 | 284 | //return str; |
supershiu | 2:020a3715aac4 | 285 | } |
supershiu | 2:020a3715aac4 | 286 | if(c == '0') |
supershiu | 2:020a3715aac4 | 287 | { |
supershiu | 2:020a3715aac4 | 288 | str = "Open A string"; |
supershiu | 2:020a3715aac4 | 289 | return str; |
Owen | 0:a51a6e7da590 | 290 | } |
Owen | 0:a51a6e7da590 | 291 | } |
supershiu | 2:020a3715aac4 | 292 | if(p == 4) |
supershiu | 2:020a3715aac4 | 293 | { |
supershiu | 2:020a3715aac4 | 294 | str = "Open E"; |
supershiu | 2:020a3715aac4 | 295 | if(c == 'r') |
supershiu | 2:020a3715aac4 | 296 | { |
supershiu | 2:020a3715aac4 | 297 | str = "E string B flat"; |
supershiu | 2:020a3715aac4 | 298 | //return str; |
supershiu | 2:020a3715aac4 | 299 | } |
supershiu | 2:020a3715aac4 | 300 | if(c == 'e') |
supershiu | 2:020a3715aac4 | 301 | { |
supershiu | 2:020a3715aac4 | 302 | str = "E string A flat"; |
supershiu | 2:020a3715aac4 | 303 | //return str; |
supershiu | 2:020a3715aac4 | 304 | } |
supershiu | 2:020a3715aac4 | 305 | if(c == 'w') |
supershiu | 2:020a3715aac4 | 306 | { |
supershiu | 2:020a3715aac4 | 307 | str = "E string G flat"; |
supershiu | 2:020a3715aac4 | 308 | //return str; |
supershiu | 2:020a3715aac4 | 309 | } |
supershiu | 2:020a3715aac4 | 310 | if(c == 'q') |
supershiu | 2:020a3715aac4 | 311 | { |
supershiu | 2:020a3715aac4 | 312 | str = "E string F flat"; |
supershiu | 2:020a3715aac4 | 313 | //return str; |
supershiu | 2:020a3715aac4 | 314 | } |
supershiu | 2:020a3715aac4 | 315 | if(c == 'f') |
supershiu | 2:020a3715aac4 | 316 | { |
supershiu | 2:020a3715aac4 | 317 | str = "E string B"; |
supershiu | 2:020a3715aac4 | 318 | //return str; |
supershiu | 2:020a3715aac4 | 319 | } |
supershiu | 2:020a3715aac4 | 320 | if(c == 'd') |
supershiu | 2:020a3715aac4 | 321 | { |
supershiu | 2:020a3715aac4 | 322 | str = "E string A"; |
supershiu | 2:020a3715aac4 | 323 | //return str; |
supershiu | 2:020a3715aac4 | 324 | } |
supershiu | 2:020a3715aac4 | 325 | if(c == 's') |
supershiu | 2:020a3715aac4 | 326 | { |
supershiu | 2:020a3715aac4 | 327 | str = "E string G"; |
supershiu | 2:020a3715aac4 | 328 | //return str; |
supershiu | 2:020a3715aac4 | 329 | } |
supershiu | 2:020a3715aac4 | 330 | if(c == 'a') |
supershiu | 2:020a3715aac4 | 331 | { |
supershiu | 2:020a3715aac4 | 332 | str = "E string F"; |
supershiu | 2:020a3715aac4 | 333 | //return str; |
supershiu | 2:020a3715aac4 | 334 | } |
supershiu | 2:020a3715aac4 | 335 | if(c == 'v') |
supershiu | 2:020a3715aac4 | 336 | { |
supershiu | 2:020a3715aac4 | 337 | str = "E string B sharp"; |
supershiu | 2:020a3715aac4 | 338 | //return str; |
supershiu | 2:020a3715aac4 | 339 | } |
supershiu | 2:020a3715aac4 | 340 | if(c == 'c') |
supershiu | 2:020a3715aac4 | 341 | { |
supershiu | 2:020a3715aac4 | 342 | str = "E string A sharp"; |
supershiu | 2:020a3715aac4 | 343 | //return str; |
supershiu | 2:020a3715aac4 | 344 | } |
supershiu | 2:020a3715aac4 | 345 | if(c == 'x') |
supershiu | 2:020a3715aac4 | 346 | { |
supershiu | 2:020a3715aac4 | 347 | str = "E string G sharp"; |
supershiu | 2:020a3715aac4 | 348 | //return str; |
supershiu | 2:020a3715aac4 | 349 | } |
supershiu | 2:020a3715aac4 | 350 | if(c == 'z') |
supershiu | 2:020a3715aac4 | 351 | { |
supershiu | 2:020a3715aac4 | 352 | str = "E string F sharp"; |
supershiu | 2:020a3715aac4 | 353 | //return str; |
supershiu | 2:020a3715aac4 | 354 | } |
supershiu | 2:020a3715aac4 | 355 | if(c == '0') |
supershiu | 2:020a3715aac4 | 356 | { |
supershiu | 2:020a3715aac4 | 357 | str = "Open E string"; |
supershiu | 2:020a3715aac4 | 358 | return str; |
supershiu | 2:020a3715aac4 | 359 | } |
supershiu | 2:020a3715aac4 | 360 | } |
supershiu | 2:020a3715aac4 | 361 | |
supershiu | 2:020a3715aac4 | 362 | |
supershiu | 2:020a3715aac4 | 363 | |
supershiu | 2:020a3715aac4 | 364 | return str; |
supershiu | 2:020a3715aac4 | 365 | } |