Changeset 5d7bb94 in pyramid
- Timestamp:
- 10/23/13 20:16:58 (7 years ago)
- Branches:
- master
- Children:
- 8dc32b3
- Parents:
- f5452ab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/Puzzlebox_Pyramid/Puzzlebox_Pyramid.ino
rf5452ab r5d7bb94 72 72 int eegAttention = 0; 73 73 int eegMeditation = 0; 74 int eegPower = 0; 74 75 75 76 // Operation mode … … 79 80 80 81 // Android ADK 81 AndroidAccessory acc(82 "puzzlebox",83 "PuzzleboxPyramid",84 "Puzzlebox Pyramid",85 "1.2",86 "http://pyramid.puzzlebox.info",87 "0000000000000000"88 );89 90 //AndroidAccessory acc(91 //"puzzlebox",92 //"TriggerRemote",93 //"DemoKit Arduino Board",94 //"1.0",95 //"http://www.android.com",96 //"0000000012345678"97 //);82 //AndroidAccessory acc( 83 // "puzzlebox", 84 // "PuzzleboxPyramid", 85 // "Puzzlebox Pyramid", 86 // "1.2", 87 // "http://pyramid.puzzlebox.info", 88 // "0000000000000000" 89 //); 90 91 AndroidAccessory acc( 92 "puzzlebox", 93 "TriggerRemote", 94 "DemoKit Arduino Board", 95 "1.0", 96 "http://www.android.com", 97 "0000000012345678" 98 ); 98 99 99 100 byte msg[2]; … … 419 420 RGB_Panel[11][0]=255; 420 421 RGB_Panel[11][1]=255; 421 RGB_Panel[11][2]= 128;422 RGB_Panel[11][2]=255; 422 423 } 423 424 else { … … 1082 1083 Serial.print(eegAttention, DEC); 1083 1084 Serial.print(" | eegMeditation: "); 1084 Serial.println(eegMeditation, DEC); 1085 Serial.print(eegMeditation, DEC); 1086 Serial.print(" | eegPower: "); 1087 Serial.println(eegPower, DEC); 1085 1088 1086 1089 … … 1164 1167 1165 1168 1169 if (eegPower > 0) { 1170 RGB_Panel[11][0]=255; 1171 RGB_Panel[11][1]=255; 1172 RGB_Panel[11][2]=255; 1173 _throttle=_throttle_hover; 1174 Serial.println("Throttle On"); 1175 } else { 1176 RGB_Panel[11][0]=0; 1177 RGB_Panel[11][1]=0; 1178 RGB_Panel[11][2]=0; 1179 _throttle=0; 1180 Serial.println("Throttle Off"); 1181 } // eegPower 1182 1183 1166 1184 } // updateFrameADK() 1167 1185 … … 1204 1222 if (len > 0) { 1205 1223 1206 // setColorWheel(255,255,255); // White1224 // Serial.println("INFO: ADK message received"); 1207 1225 1208 1226 if (msg[0] == 0x1) { … … 1297 1315 1298 1316 1299 // updateFrame(eegAttention, eegMeditation, eegSignal); 1300 updateFrameADK(); 1317 // EEG Power 1318 else if (msg[0] == 0x7) { 1319 Serial.println("0x7"); 1320 eegPower = 0; 1321 if (msg[1] == 0x1) { 1322 eegPower = 10; 1323 } else if (msg[1] == 0x2) { 1324 eegPower = 20; 1325 } else if (msg[1] == 0x3) { 1326 eegPower = 30; 1327 } else if (msg[1] == 0x4) { 1328 eegPower = 40; 1329 } else if (msg[1] == 0x5) { 1330 eegPower = 50; 1331 } else if (msg[1] == 0x6) { 1332 eegPower = 60; 1333 } else if (msg[1] == 0x7) { 1334 eegPower = 70; 1335 } else if (msg[1] == 0x8) { 1336 eegPower = 80; 1337 } else if (msg[1] == 0x9) { 1338 eegPower = 90; 1339 } else { 1340 eegPower = 100; 1341 Serial.println("0xa"); 1342 } 1343 } 1344 1345 1346 // // updateFrame(eegAttention, eegMeditation, eegSignal); 1347 // updateFrameADK(); 1348 1349 1301 1350 1302 1351 1303 1352 // Orbit Throttle 1304 if (msg[0] == 0x7) {1353 else if (msg[0] == 0x8) { 1305 1354 1306 Serial.println(" (msg[0] == 0x7) "); 1307 1308 int throttle = 0; 1355 Serial.println(" (msg[0] == 0x8) "); 1309 1356 1310 1357 if (msg[1] == 0x1) { 1311 throttle = _throttle_hover; 1358 setColorWheel(255,255,255); // White 1359 _throttle = _throttle_hover; 1312 1360 Serial.println(" (msg[1] == 0x1) "); 1313 } 1314 else if (msg[1] == 0x0) 1361 } 1362 else if (msg[1] == 0x0) { 1363 setColorWheel(255,0,0); // Red 1315 1364 Serial.println(" (msg[1] == 0x0) "); 1365 _throttle = 0; 1366 } 1316 1367 1317 setOrbitThrottle(throttle); 1318 1319 } else { 1320 1321 // sendFrame(1000); 1322 sendFrame(0); 1323 sendCode(formCode(_throttle,_yaw,_pitch)); 1324 delay(80); //cycle(); 1325 } 1326 1327 // setColorWheel(255,0,0); // Red 1368 } // (msg[0] == 0x8) 1328 1369 1329 1370 } // len 1330 else { 1331 // setColorWheel(255, 0, 0); // red 1332 delay(80); //cycle(); 1333 } 1371 1372 sendCode(formCode(_throttle,_yaw,_pitch)); 1373 delay(80); //cycle(); 1374 1375 1334 1376 } // if acc.isConnected() 1335 1377 … … 1338 1380 1339 1381 1340 1341
Note: See TracChangeset
for help on using the changeset viewer.