Advertisement
joymonkey

SHADOW_MD_Q85

Mar 4th, 2017
1,511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 234.60 KB | None | 0 0
  1. // =======================================================================================
  2. //        SHADOW_MD:  Small Handheld Arduino Droid Operating Wand + MarcDuino
  3. // =======================================================================================
  4. //                          Last Revised Date: 08/23/2015
  5. //                             Revised By: vint43
  6. //                Inspired by the PADAWAN / KnightShade SHADOW effort
  7. //                           (Q85 stuff added by Paul Murphy, mostly stolen from Brad/BHD)
  8. // =======================================================================================
  9. //
  10. //         This program is free software: you can redistribute it and/or modify it for
  11. //         your personal use and the personal use of other astromech club members.  
  12. //
  13. //         This program is distributed in the hope that it will be useful
  14. //         as a courtesy to fellow astromech club members wanting to develop
  15. //         their own droid control system.
  16. //
  17. //         IT IS OFFERED WITHOUT ANY WARRANTY; without even the implied warranty of
  18. //         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  19. //
  20. //         You are using this software at your own risk and, as a fellow club member, it is
  21. //         expected you will have the proper experience / background to handle and manage that
  22. //         risk appropriately.  It is completely up to you to insure the safe operation of
  23. //         your droid and to validate and test all aspects of your droid control system.
  24. //
  25. // =======================================================================================
  26. //   Note: You will need a Arduino Mega ADK rev3 to run this sketch,
  27. //   as a normal Arduino (Uno, Duemilanove etc.) doesn't have enough SRAM and FLASH
  28. //
  29. //   This is written to be a SPECIFIC Sketch - supporting only one type of controller
  30. //      - PS3 Move Navigation + MarcDuino Dome Controller & Optional Body Panel Controller
  31. //
  32. //   PS3 Bluetooth library - developed by Kristian Lauszus (kristianl@tkjelectronics.com)
  33. //   For more information visit my blog: http://blog.tkjelectronics.dk/ or
  34. //
  35. //   Sabertooth (Foot Drive):
  36. //         Set Sabertooth 2x32 or 2x25 Dip Switches: 1 and 2 Down, All Others Up
  37. //
  38. //   SyRen 10 Dome Drive:
  39. //         For SyRen packetized Serial Set Switches: 1, 2 and 4 Down, All Others Up
  40. //         NOTE:  Support for SyRen Simple Serial has been removed, due to problems.
  41. //         Please contact DimensionEngineering to get an RMA to flash your firmware
  42. //         Some place a 10K ohm resistor between S1 & GND on the SyRen 10 itself
  43. //
  44. // =======================================================================================
  45. //
  46. // ---------------------------------------------------------------------------------------
  47. //                        General User Settings
  48. // ---------------------------------------------------------------------------------------
  49.  
  50. #define FOOT_CONTROLLER 1 //0 for Sabertooth Serial or 1 for individual R/C output (for Q85 motors with 1 controller for each foot, or Sabertooth Mode 2 Independant Mixing)
  51.  
  52. String PS3ControllerFootMac = "00:06:F7:C2:XX:XX";  //Set this to your FOOT PS3 controller MAC address
  53. String PS3ControllerDomeMAC = "00:07:04:B7:XX:XX";  //Set to a secondary DOME PS3 controller MAC address (Optional)
  54.  
  55. String PS3ControllerBackupFootMac = "XX";  //Set to the MAC Address of your BACKUP FOOT controller (Optional)
  56. String PS3ControllerBackupDomeMAC = "XX";  //Set to the MAC Address of your BACKUP DOME controller (Optional)
  57.  
  58. byte drivespeed1 = 20;   //For Speed Setting (Normal): set this to whatever speeds works for you. 0-stop, 127-full speed.
  59. byte drivespeed2 = 127;   //For Speed Setting (Over Throttle): set this for when needing extra power. 0-stop, 127-full speed.
  60.  
  61. byte turnspeed = 50;      // the higher this number the faster it will spin in place, lower - the easier to control.
  62.                          // Recommend beginner: 40 to 50, experienced: 50+, I like 75
  63.  
  64. byte domespeed = 100;    // If using a speed controller for the dome, sets the top speed
  65.                          // Use a number up to 127
  66.  
  67. byte ramping = 1;        // Ramping- the lower this number the longer R2 will take to speedup or slow down,
  68.                          // change this by increments of 1
  69.  
  70. byte joystickFootDeadZoneRange = 15;  // For controllers that centering problems, use the lowest number with no drift
  71. byte joystickDomeDeadZoneRange = 10;  // For controllers that centering problems, use the lowest number with no drift
  72.  
  73. byte driveDeadBandRange = 10;     // Used to set the Sabertooth DeadZone for foot motors
  74.  
  75. int invertTurnDirection = -1;   //This may need to be set to 1 for some configurations
  76.  
  77. byte domeAutoSpeed = 70;     // Speed used when dome automation is active - Valid Values: 50 - 100
  78. int time360DomeTurn = 2500;  // milliseconds for dome to complete 360 turn at domeAutoSpeed - Valid Values: 2000 - 8000 (2000 = 2 seconds)
  79.  
  80. #define SHADOW_DEBUG       //uncomment this for console DEBUG output
  81. #define SHADOW_VERBOSE     //uncomment this for console VERBOSE output
  82.  
  83. // ---------------------------------------------------------------------------------------
  84. //                          MarcDuino Button Settings
  85. // ---------------------------------------------------------------------------------------
  86. // Std MarcDuino Function Codes:
  87. //     1 = Close All Panels
  88. //     2 = Scream - all panels open
  89. //     3 = Wave, One Panel at a time
  90. //     4 = Fast (smirk) back and forth wave
  91. //     5 = Wave 2, Open progressively all panels, then close one by one
  92. //     6 = Beep cantina - w/ marching ants panel action
  93. //     7 = Faint / Short Circuit
  94. //     8 = Cantina Dance - orchestral, rhythmic panel dance
  95. //     9 = Leia message
  96. //    10 = Disco
  97. //    11 = Quite mode reset (panel close, stop holos, stop sounds)
  98. //    12 = Full Awake mode reset (panel close, rnd sound, holo move,holo lights off)
  99. //    13 = Mid Awake mode reset (panel close, rnd sound, stop holos)
  100. //    14 = Full Awake+ reset (panel close, rnd sound, holo move, holo lights on)
  101. //    15 = Scream, with all panels open (NO SOUND)
  102. //    16 = Wave, one panel at a time (NO SOUND)
  103. //    17 = Fast (smirk) back and forth (NO SOUND)
  104. //    18 = Wave 2 (Open progressively, then close one by one) (NO SOUND)
  105. //    19 = Marching Ants (NO SOUND)
  106. //    20 = Faint/Short Circuit (NO SOUND)
  107. //    21 = Rhythmic cantina dance (NO SOUND)
  108. //    22 = Random Holo Movement On (All) - No other actions
  109. //    23 = Holo Lights On (All)
  110. //    24 = Holo Lights Off (All)
  111. //    25 = Holo reset (motion off, lights off)
  112. //    26 = Volume Up
  113. //    27 = Volume Down
  114. //    28 = Volume Max
  115. //    29 = Volume Mid
  116. //    30 = Open All Dome Panels
  117. //    31 = Open Top Dome Panels
  118. //    32 = Open Bottom Dome Panels
  119. //    33 = Close All Dome Panels
  120. //    34 = Open Dome Panel #1
  121. //    35 = Close Dome Panel #1
  122. //    36 = Open Dome Panel #2
  123. //    37 = Close Dome Panel #2
  124. //    38 = Open Dome Panel #3
  125. //    39 = Close Dome Panel #3
  126. //    40 = Open Dome Panel #4
  127. //    41 = Close Dome Panel #4
  128. //    42 = Open Dome Panel #5
  129. //    43 = Close Dome Panel #5
  130. //    44 = Open Dome Panel #6
  131. //    45 = Close Dome Panel #6
  132. //    46 = Open Dome Panel #7
  133. //    47 = Close Dome Panel #7
  134. //    48 = Open Dome Panel #8
  135. //    49 = Close Dome Panel #8
  136. //    50 = Open Dome Panel #9
  137. //    51 = Close Dome Panel #9
  138. //    52 = Open Dome Panel #10
  139. //    53 = Close Dome Panel #10
  140. //   *** BODY PANEL OPTIONS ASSUME SECOND MARCDUINO MASTER BOARD ON MEGA ADK SERIAL #3 ***
  141. //    54 = Open All Body Panels
  142. //    55 = Close All Body Panels
  143. //    56 = Open Body Panel #1
  144. //    57 = Close Body Panel #1
  145. //    58 = Open Body Panel #2
  146. //    59 = Close Body Panel #2
  147. //    60 = Open Body Panel #3
  148. //    61 = Close Body Panel #3
  149. //    62 = Open Body Panel #4
  150. //    63 = Close Body Panel #4
  151. //    64 = Open Body Panel #5
  152. //    65 = Close Body Panel #5
  153. //    66 = Open Body Panel #6
  154. //    67 = Close Body Panel #6
  155. //    68 = Open Body Panel #7
  156. //    69 = Close Body Panel #7
  157. //    70 = Open Body Panel #8
  158. //    71 = Close Body Panel #8
  159. //    72 = Open Body Panel #9
  160. //    73 = Close Body Panel #9
  161. //    74 = Open Body Panel #10
  162. //    75 = Close Body Panel #10
  163. //   *** MAGIC PANEL LIGHTING COMMANDS
  164. //    76 = Magic Panel ON
  165. //    77 = Magic Panel OFF
  166. //    78 = Magic Panel Flicker (10 seconds)
  167. //
  168. // Std MarcDuino Logic Display Functions (For custom functions)
  169. //     1 = Display normal random sequence
  170. //     2 = Short circuit (10 second display sequence)
  171. //     3 = Scream (flashing light display sequence)
  172. //     4 = Leia (34 second light sequence)
  173. //     5 = Display “Star Wars”
  174. //     6 = March light sequence
  175. //     7 = Spectrum, bar graph display sequence
  176. //     8 = Display custom text
  177. //
  178. // Std MarcDuino Panel Functions (For custom functions)
  179. //     1 = Panels stay closed (normal position)
  180. //     2 = Scream sequence, all panels open
  181. //     3 = Wave panel sequence
  182. //     4 = Fast (smirk) back and forth panel sequence
  183. //     5 = Wave 2 panel sequence, open progressively all panels, then close one by one)
  184. //     6 = Marching ants panel sequence
  185. //     7 = Faint / short circuit panel sequence
  186. //     8 = Rhythmic cantina panel sequence
  187. //     9 = Custom Panel Sequence
  188.  
  189.  
  190. //----------------------------------------------------
  191. // CONFIGURE: The FOOT Navigation Controller Buttons
  192. //----------------------------------------------------
  193.  
  194. //---------------------------------
  195. // CONFIGURE: Arrow Up
  196. //---------------------------------
  197. //1 = Std MarcDuino Function, 2 = Custom Function
  198. int btnUP_type = 1;    
  199.  
  200. // IF Std MarcDuino Function (type=1)
  201. // Enter MarcDuino Function Code (1 - 78) (See Above)
  202. int btnUP_MD_func = 12;
  203.  
  204. // IF Custom Function (type=2)
  205. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  206. // Valid values: 0 or 182 - 200  
  207. int btnUP_cust_MP3_num = 0;  
  208.  
  209. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  210. // Valid values: 0, 1 to 8  (0 - Not used)
  211. int btnUP_cust_LD_type = 0;
  212.  
  213. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  214. String btnUP_cust_LD_text = "";
  215.  
  216. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  217. // Valid Values: 0, 1 to 9 (0 = Not used)
  218. int btnUP_cust_panel = 0;
  219.  
  220. // IF Custom Panel Setting = 9 (custom panel sequence)
  221. // Dome Panel #1
  222. boolean btnUP_use_DP1 = false;
  223. int btnUP_DP1_open_start_delay = 1; // in seconds (0 to 30)
  224. int btnUP_DP1_stay_open_time = 5; // in seconds (1 to 30)
  225. // Dome Panel #2
  226. boolean btnUP_use_DP2 = false;
  227. int btnUP_DP2_open_start_delay = 1; // in seconds (0 to 30)
  228. int btnUP_DP2_stay_open_time = 5; // in seconds (1 to 30)
  229. // Dome Panel #3
  230. boolean btnUP_use_DP3 = false;
  231. int btnUP_DP3_open_start_delay = 1; // in seconds (0 to 30)
  232. int btnUP_DP3_stay_open_time = 5; // in seconds (1 to 30)
  233. // Dome Panel #4
  234. boolean btnUP_use_DP4 = false;
  235. int btnUP_DP4_open_start_delay = 1; // in seconds (0 to 30)
  236. int btnUP_DP4_stay_open_time = 5; // in seconds (1 to 30)
  237. // Dome Panel #5
  238. boolean btnUP_use_DP5 = false;
  239. int btnUP_DP5_open_start_delay = 1; // in seconds (0 to 30)
  240. int btnUP_DP5_stay_open_time = 5; // in seconds (1 to 30)
  241. // Dome Panel #6
  242. boolean btnUP_use_DP6 = false;
  243. int btnUP_DP6_open_start_delay = 1; // in seconds (0 to 30)
  244. int btnUP_DP6_stay_open_time = 5; // in seconds (1 to 30)
  245. // Dome Panel #7
  246. boolean btnUP_use_DP7 = false;
  247. int btnUP_DP7_open_start_delay = 1; // in seconds (0 to 30)
  248. int btnUP_DP7_stay_open_time = 5; // in seconds (1 to 30)
  249. // Dome Panel #8
  250. boolean btnUP_use_DP8 = false;
  251. int btnUP_DP8_open_start_delay = 1; // in seconds (0 to 30)
  252. int btnUP_DP8_stay_open_time = 5; // in seconds (1 to 30)
  253. // Dome Panel #9
  254. boolean btnUP_use_DP9 = false;
  255. int btnUP_DP9_open_start_delay = 1; // in seconds (0 to 30)
  256. int btnUP_DP9_stay_open_time = 5; // in seconds (1 to 30)
  257. // Dome Panel #10
  258. boolean btnUP_use_DP10 = false;
  259. int btnUP_DP10_open_start_delay = 1; // in seconds (0 to 30)
  260. int btnUP_DP10_stay_open_time = 5; // in seconds (1 to 30)
  261.  
  262. //---------------------------------
  263. // CONFIGURE: Arrow Left
  264. //---------------------------------
  265. //1 = Std MarcDuino Function, 2 = Custom Function
  266. int btnLeft_type = 1;    
  267.  
  268. // IF Std MarcDuino Function (type=1)
  269. // Enter MarcDuino Function Code (1 - 78) (See Above)
  270. int btnLeft_MD_func = 13;
  271.  
  272. // IF Custom Function (type=2)
  273. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  274. // Valid values: 0 or 182 - 200  
  275. int btnLeft_cust_MP3_num = 0;  
  276.  
  277. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  278. // Valid values: 0, 1 to 8  (0 - Not used)
  279. int btnLeft_cust_LD_type = 0;
  280.  
  281. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  282. String btnLeft_cust_LD_text = "";
  283.  
  284. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  285. // Valid Values: 0, 1 to 9 (0 = Not used)
  286. int btnLeft_cust_panel = 0;
  287.  
  288. // IF Custom Panel Setting = 9 (custom panel sequence)
  289. // Dome Panel #1
  290. boolean btnLeft_use_DP1 = false;
  291. int btnLeft_DP1_open_start_delay = 1; // in seconds (0 to 30)
  292. int btnLeft_DP1_stay_open_time = 5; // in seconds (1 to 30)
  293. // Dome Panel #2
  294. boolean btnLeft_use_DP2 = false;
  295. int btnLeft_DP2_open_start_delay = 1; // in seconds (0 to 30)
  296. int btnLeft_DP2_stay_open_time = 5; // in seconds (1 to 30)
  297. // Dome Panel #3
  298. boolean btnLeft_use_DP3 = false;
  299. int btnLeft_DP3_open_start_delay = 1; // in seconds (0 to 30)
  300. int btnLeft_DP3_stay_open_time = 5; // in seconds (1 to 30)
  301. // Dome Panel #4
  302. boolean btnLeft_use_DP4 = false;
  303. int btnLeft_DP4_open_start_delay = 1; // in seconds (0 to 30)
  304. int btnLeft_DP4_stay_open_time = 5; // in seconds (1 to 30)
  305. // Dome Panel #5
  306. boolean btnLeft_use_DP5 = false;
  307. int btnLeft_DP5_open_start_delay = 1; // in seconds (0 to 30)
  308. int btnLeft_DP5_stay_open_time = 5; // in seconds (1 to 30)
  309. // Dome Panel #6
  310. boolean btnLeft_use_DP6 = false;
  311. int btnLeft_DP6_open_start_delay = 1; // in seconds (0 to 30)
  312. int btnLeft_DP6_stay_open_time = 5; // in seconds (1 to 30)
  313. // Dome Panel #7
  314. boolean btnLeft_use_DP7 = false;
  315. int btnLeft_DP7_open_start_delay = 1; // in seconds (0 to 30)
  316. int btnLeft_DP7_stay_open_time = 5; // in seconds (1 to 30)
  317. // Dome Panel #8
  318. boolean btnLeft_use_DP8 = false;
  319. int btnLeft_DP8_open_start_delay = 1; // in seconds (0 to 30)
  320. int btnLeft_DP8_stay_open_time = 5; // in seconds (1 to 30)
  321. // Dome Panel #9
  322. boolean btnLeft_use_DP9 = false;
  323. int btnLeft_DP9_open_start_delay = 1; // in seconds (0 to 30)
  324. int btnLeft_DP9_stay_open_time = 5; // in seconds (1 to 30)
  325. // Dome Panel #10
  326. boolean btnLeft_use_DP10 = false;
  327. int btnLeft_DP10_open_start_delay = 1; // in seconds (0 to 30)
  328. int btnLeft_DP10_stay_open_time = 5; // in seconds (1 to 30)
  329.  
  330. //---------------------------------
  331. // CONFIGURE: Arrow Right
  332. //---------------------------------
  333. //1 = Std MarcDuino Function, 2 = Custom Function
  334. int btnRight_type = 1;    
  335.  
  336. // IF Std MarcDuino Function (type=1)
  337. // Enter MarcDuino Function Code (1 - 78) (See Above)
  338. int btnRight_MD_func = 14;
  339.  
  340. // IF Custom Function (type=2)
  341. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  342. // Valid values: 0 or 182 - 200  
  343. int btnRight_cust_MP3_num = 0;  
  344.  
  345. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  346. // Valid values: 0, 1 to 8  (0 - Not used)
  347. int btnRight_cust_LD_type = 0;
  348.  
  349. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  350. String btnRight_cust_LD_text = "";
  351.  
  352. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  353. // Valid Values: 0, 1 to 9 (0 = Not used)
  354. int btnRight_cust_panel = 0;
  355.  
  356. // IF Custom Panel Setting = 9 (custom panel sequence)
  357. // Dome Panel #1
  358. boolean btnRight_use_DP1 = false;
  359. int btnRight_DP1_open_start_delay = 1; // in seconds (0 to 30)
  360. int btnRight_DP1_stay_open_time = 5; // in seconds (1 to 30)
  361. // Dome Panel #2
  362. boolean btnRight_use_DP2 = false;
  363. int btnRight_DP2_open_start_delay = 1; // in seconds (0 to 30)
  364. int btnRight_DP2_stay_open_time = 5; // in seconds (1 to 30)
  365. // Dome Panel #3
  366. boolean btnRight_use_DP3 = false;
  367. int btnRight_DP3_open_start_delay = 1; // in seconds (0 to 30)
  368. int btnRight_DP3_stay_open_time = 5; // in seconds (1 to 30)
  369. // Dome Panel #4
  370. boolean btnRight_use_DP4 = false;
  371. int btnRight_DP4_open_start_delay = 1; // in seconds (0 to 30)
  372. int btnRight_DP4_stay_open_time = 5; // in seconds (1 to 30)
  373. // Dome Panel #5
  374. boolean btnRight_use_DP5 = false;
  375. int btnRight_DP5_open_start_delay = 1; // in seconds (0 to 30)
  376. int btnRight_DP5_stay_open_time = 5; // in seconds (1 to 30)
  377. // Dome Panel #6
  378. boolean btnRight_use_DP6 = false;
  379. int btnRight_DP6_open_start_delay = 1; // in seconds (0 to 30)
  380. int btnRight_DP6_stay_open_time = 5; // in seconds (1 to 30)
  381. // Dome Panel #7
  382. boolean btnRight_use_DP7 = false;
  383. int btnRight_DP7_open_start_delay = 1; // in seconds (0 to 30)
  384. int btnRight_DP7_stay_open_time = 5; // in seconds (1 to 30)
  385. // Dome Panel #8
  386. boolean btnRight_use_DP8 = false;
  387. int btnRight_DP8_open_start_delay = 1; // in seconds (0 to 30)
  388. int btnRight_DP8_stay_open_time = 5; // in seconds (1 to 30)
  389. // Dome Panel #9
  390. boolean btnRight_use_DP9 = false;
  391. int btnRight_DP9_open_start_delay = 1; // in seconds (0 to 30)
  392. int btnRight_DP9_stay_open_time = 5; // in seconds (1 to 30)
  393. // Dome Panel #10
  394. boolean btnRight_use_DP10 = false;
  395. int btnRight_DP10_open_start_delay = 1; // in seconds (0 to 30)
  396. int btnRight_DP10_stay_open_time = 5; // in seconds (1 to 30)
  397.  
  398. //---------------------------------
  399. // CONFIGURE: Arrow Down
  400. //---------------------------------
  401. //1 = Std MarcDuino Function, 2 = Custom Function
  402. int btnDown_type = 1;    
  403.  
  404. // IF Std MarcDuino Function (type=1)
  405. // Enter MarcDuino Function Code (1 - 78) (See Above)
  406. int btnDown_MD_func = 11;
  407.  
  408. // IF Custom Function (type=2)
  409. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  410. // Valid values: 0 or 182 - 200  
  411. int btnDown_cust_MP3_num = 0;  
  412.  
  413. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  414. // Valid values: 0, 1 to 8  (0 - Not used)
  415. int btnDown_cust_LD_type = 0;
  416.  
  417. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  418. String btnDown_cust_LD_text = "";
  419.  
  420. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  421. // Valid Values: 0, 1 to 9 (0 = Not used)
  422. int btnDown_cust_panel = 0;
  423.  
  424. // IF Custom Panel Setting = 9 (custom panel sequence)
  425. // Dome Panel #1
  426. boolean btnDown_use_DP1 = false;
  427. int btnDown_DP1_open_start_delay = 1; // in seconds (0 to 30)
  428. int btnDown_DP1_stay_open_time = 5; // in seconds (1 to 30)
  429. // Dome Panel #2
  430. boolean btnDown_use_DP2 = false;
  431. int btnDown_DP2_open_start_delay = 1; // in seconds (0 to 30)
  432. int btnDown_DP2_stay_open_time = 5; // in seconds (1 to 30)
  433. // Dome Panel #3
  434. boolean btnDown_use_DP3 = false;
  435. int btnDown_DP3_open_start_delay = 1; // in seconds (0 to 30)
  436. int btnDown_DP3_stay_open_time = 5; // in seconds (1 to 30)
  437. // Dome Panel #4
  438. boolean btnDown_use_DP4 = false;
  439. int btnDown_DP4_open_start_delay = 1; // in seconds (0 to 30)
  440. int btnDown_DP4_stay_open_time = 5; // in seconds (1 to 30)
  441. // Dome Panel #5
  442. boolean btnDown_use_DP5 = false;
  443. int btnDown_DP5_open_start_delay = 1; // in seconds (0 to 30)
  444. int btnDown_DP5_stay_open_time = 5; // in seconds (1 to 30)
  445. // Dome Panel #6
  446. boolean btnDown_use_DP6 = false;
  447. int btnDown_DP6_open_start_delay = 1; // in seconds (0 to 30)
  448. int btnDown_DP6_stay_open_time = 5; // in seconds (1 to 30)
  449. // Dome Panel #7
  450. boolean btnDown_use_DP7 = false;
  451. int btnDown_DP7_open_start_delay = 1; // in seconds (0 to 30)
  452. int btnDown_DP7_stay_open_time = 5; // in seconds (1 to 30)
  453. // Dome Panel #8
  454. boolean btnDown_use_DP8 = false;
  455. int btnDown_DP8_open_start_delay = 1; // in seconds (0 to 30)
  456. int btnDown_DP8_stay_open_time = 5; // in seconds (1 to 30)
  457. // Dome Panel #9
  458. boolean btnDown_use_DP9 = false;
  459. int btnDown_DP9_open_start_delay = 1; // in seconds (0 to 30)
  460. int btnDown_DP9_stay_open_time = 5; // in seconds (1 to 30)
  461. // Dome Panel #10
  462. boolean btnDown_use_DP10 = false;
  463. int btnDown_DP10_open_start_delay = 1; // in seconds (0 to 30)
  464. int btnDown_DP10_stay_open_time = 5; // in seconds (1 to 30)
  465.  
  466. //---------------------------------
  467. // CONFIGURE: Arrow UP + CROSS
  468. //---------------------------------
  469. //1 = Std MarcDuino Function, 2 = Custom Function
  470. int btnUP_CROSS_type = 1;    
  471.  
  472. // IF Std MarcDuino Function (type=1)
  473. // Enter MarcDuino Function Code (1 - 78) (See Above)
  474. int btnUP_CROSS_MD_func = 26;
  475.  
  476. // IF Custom Function (type=2)
  477. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  478. // Valid values: 0 or 182 - 200  
  479. int btnUP_CROSS_cust_MP3_num = 0;  
  480.  
  481. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  482. // Valid values: 0, 1 to 8  (0 - Not used)
  483. int btnUP_CROSS_cust_LD_type = 0;
  484.  
  485. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  486. String btnUP_CROSS_cust_LD_text = "";
  487.  
  488. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  489. // Valid Values: 0, 1 to 9 (0 = Not used)
  490. int btnUP_CROSS_cust_panel = 0;
  491.  
  492. // IF Custom Panel Setting = 9 (custom panel sequence)
  493. // Dome Panel #1
  494. boolean btnUP_CROSS_use_DP1 = false;
  495. int btnUP_CROSS_DP1_open_start_delay = 1; // in seconds (0 to 30)
  496. int btnUP_CROSS_DP1_stay_open_time = 5; // in seconds (1 to 30)
  497. // Dome Panel #2
  498. boolean btnUP_CROSS_use_DP2 = false;
  499. int btnUP_CROSS_DP2_open_start_delay = 1; // in seconds (0 to 30)
  500. int btnUP_CROSS_DP2_stay_open_time = 5; // in seconds (1 to 30)
  501. // Dome Panel #3
  502. boolean btnUP_CROSS_use_DP3 = false;
  503. int btnUP_CROSS_DP3_open_start_delay = 1; // in seconds (0 to 30)
  504. int btnUP_CROSS_DP3_stay_open_time = 5; // in seconds (1 to 30)
  505. // Dome Panel #4
  506. boolean btnUP_CROSS_use_DP4 = false;
  507. int btnUP_CROSS_DP4_open_start_delay = 1; // in seconds (0 to 30)
  508. int btnUP_CROSS_DP4_stay_open_time = 5; // in seconds (1 to 30)
  509. // Dome Panel #5
  510. boolean btnUP_CROSS_use_DP5 = false;
  511. int btnUP_CROSS_DP5_open_start_delay = 1; // in seconds (0 to 30)
  512. int btnUP_CROSS_DP5_stay_open_time = 5; // in seconds (1 to 30)
  513. // Dome Panel #6
  514. boolean btnUP_CROSS_use_DP6 = false;
  515. int btnUP_CROSS_DP6_open_start_delay = 1; // in seconds (0 to 30)
  516. int btnUP_CROSS_DP6_stay_open_time = 5; // in seconds (1 to 30)
  517. // Dome Panel #7
  518. boolean btnUP_CROSS_use_DP7 = false;
  519. int btnUP_CROSS_DP7_open_start_delay = 1; // in seconds (0 to 30)
  520. int btnUP_CROSS_DP7_stay_open_time = 5; // in seconds (1 to 30)
  521. // Dome Panel #8
  522. boolean btnUP_CROSS_use_DP8 = false;
  523. int btnUP_CROSS_DP8_open_start_delay = 1; // in seconds (0 to 30)
  524. int btnUP_CROSS_DP8_stay_open_time = 5; // in seconds (1 to 30)
  525. // Dome Panel #9
  526. boolean btnUP_CROSS_use_DP9 = false;
  527. int btnUP_CROSS_DP9_open_start_delay = 1; // in seconds (0 to 30)
  528. int btnUP_CROSS_DP9_stay_open_time = 5; // in seconds (1 to 30)
  529. // Dome Panel #10
  530. boolean btnUP_CROSS_use_DP10 = false;
  531. int btnUP_CROSS_DP10_open_start_delay = 1; // in seconds (0 to 30)
  532. int btnUP_CROSS_DP10_stay_open_time = 5; // in seconds (1 to 30)
  533.  
  534. //---------------------------------
  535. // CONFIGURE: Arrow Left + CROSS
  536. //---------------------------------
  537. //1 = Std MarcDuino Function, 2 = Custom Function
  538. int btnLeft_CROSS_type = 1;    
  539.  
  540. // IF Std MarcDuino Function (type=1)
  541. // Enter MarcDuino Function Code (1 - 78) (See Above)
  542. int btnLeft_CROSS_MD_func = 23;
  543.  
  544. // IF Custom Function (type=2)
  545. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  546. // Valid values: 0 or 182 - 200  
  547. int btnLeft_CROSS_cust_MP3_num = 0;  
  548.  
  549. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  550. // Valid values: 0, 1 to 8  (0 - Not used)
  551. int btnLeft_CROSS_cust_LD_type = 0;
  552.  
  553. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  554. String btnLeft_CROSS_cust_LD_text = "";
  555.  
  556. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  557. // Valid Values: 0, 1 to 9 (0 = Not used)
  558. int btnLeft_CROSS_cust_panel = 0;
  559.  
  560. // IF Custom Panel Setting = 9 (custom panel sequence)
  561. // Dome Panel #1
  562. boolean btnLeft_CROSS_use_DP1 = false;
  563. int btnLeft_CROSS_DP1_open_start_delay = 1; // in seconds (0 to 30)
  564. int btnLeft_CROSS_DP1_stay_open_time = 5; // in seconds (1 to 30)
  565. // Dome Panel #2
  566. boolean btnLeft_CROSS_use_DP2 = false;
  567. int btnLeft_CROSS_DP2_open_start_delay = 1; // in seconds (0 to 30)
  568. int btnLeft_CROSS_DP2_stay_open_time = 5; // in seconds (1 to 30)
  569. // Dome Panel #3
  570. boolean btnLeft_CROSS_use_DP3 = false;
  571. int btnLeft_CROSS_DP3_open_start_delay = 1; // in seconds (0 to 30)
  572. int btnLeft_CROSS_DP3_stay_open_time = 5; // in seconds (1 to 30)
  573. // Dome Panel #4
  574. boolean btnLeft_CROSS_use_DP4 = false;
  575. int btnLeft_CROSS_DP4_open_start_delay = 1; // in seconds (0 to 30)
  576. int btnLeft_CROSS_DP4_stay_open_time = 5; // in seconds (1 to 30)
  577. // Dome Panel #5
  578. boolean btnLeft_CROSS_use_DP5 = false;
  579. int btnLeft_CROSS_DP5_open_start_delay = 1; // in seconds (0 to 30)
  580. int btnLeft_CROSS_DP5_stay_open_time = 5; // in seconds (1 to 30)
  581. // Dome Panel #6
  582. boolean btnLeft_CROSS_use_DP6 = false;
  583. int btnLeft_CROSS_DP6_open_start_delay = 1; // in seconds (0 to 30)
  584. int btnLeft_CROSS_DP6_stay_open_time = 5; // in seconds (1 to 30)
  585. // Dome Panel #7
  586. boolean btnLeft_CROSS_use_DP7 = false;
  587. int btnLeft_CROSS_DP7_open_start_delay = 1; // in seconds (0 to 30)
  588. int btnLeft_CROSS_DP7_stay_open_time = 5; // in seconds (1 to 30)
  589. // Dome Panel #8
  590. boolean btnLeft_CROSS_use_DP8 = false;
  591. int btnLeft_CROSS_DP8_open_start_delay = 1; // in seconds (0 to 30)
  592. int btnLeft_CROSS_DP8_stay_open_time = 5; // in seconds (1 to 30)
  593. // Dome Panel #9
  594. boolean btnLeft_CROSS_use_DP9 = false;
  595. int btnLeft_CROSS_DP9_open_start_delay = 1; // in seconds (0 to 30)
  596. int btnLeft_CROSS_DP9_stay_open_time = 5; // in seconds (1 to 30)
  597. // Dome Panel #10
  598. boolean btnLeft_CROSS_use_DP10 = false;
  599. int btnLeft_CROSS_DP10_open_start_delay = 1; // in seconds (0 to 30)
  600. int btnLeft_CROSS_DP10_stay_open_time = 5; // in seconds (1 to 30)
  601.  
  602. //---------------------------------
  603. // CONFIGURE: Arrow Right + CROSS
  604. //---------------------------------
  605. //1 = Std MarcDuino Function, 2 = Custom Function
  606. int btnRight_CROSS_type = 1;    
  607.  
  608. // IF Std MarcDuino Function (type=1)
  609. // Enter MarcDuino Function Code (1 - 78) (See Above)
  610. int btnRight_CROSS_MD_func = 24;
  611.  
  612. // IF Custom Function (type=2)
  613. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  614. // Valid values: 0 or 182 - 200  
  615. int btnRight_CROSS_cust_MP3_num = 0;  
  616.  
  617. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  618. // Valid values: 0, 1 to 8  (0 - Not used)
  619. int btnRight_CROSS_cust_LD_type = 0;
  620.  
  621. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  622. String btnRight_CROSS_cust_LD_text = "";
  623.  
  624. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  625. // Valid Values: 0, 1 to 9 (0 = Not used)
  626. int btnRight_CROSS_cust_panel = 0;
  627.  
  628. // IF Custom Panel Setting = 9 (custom panel sequence)
  629. // Dome Panel #1
  630. boolean btnRight_CROSS_use_DP1 = false;
  631. int btnRight_CROSS_DP1_open_start_delay = 1; // in seconds (0 to 30)
  632. int btnRight_CROSS_DP1_stay_open_time = 5; // in seconds (1 to 30)
  633. // Dome Panel #2
  634. boolean btnRight_CROSS_use_DP2 = false;
  635. int btnRight_CROSS_DP2_open_start_delay = 1; // in seconds (0 to 30)
  636. int btnRight_CROSS_DP2_stay_open_time = 5; // in seconds (1 to 30)
  637. // Dome Panel #3
  638. boolean btnRight_CROSS_use_DP3 = false;
  639. int btnRight_CROSS_DP3_open_start_delay = 1; // in seconds (0 to 30)
  640. int btnRight_CROSS_DP3_stay_open_time = 5; // in seconds (1 to 30)
  641. // Dome Panel #4
  642. boolean btnRight_CROSS_use_DP4 = false;
  643. int btnRight_CROSS_DP4_open_start_delay = 1; // in seconds (0 to 30)
  644. int btnRight_CROSS_DP4_stay_open_time = 5; // in seconds (1 to 30)
  645. // Dome Panel #5
  646. boolean btnRight_CROSS_use_DP5 = false;
  647. int btnRight_CROSS_DP5_open_start_delay = 1; // in seconds (0 to 30)
  648. int btnRight_CROSS_DP5_stay_open_time = 5; // in seconds (1 to 30)
  649. // Dome Panel #6
  650. boolean btnRight_CROSS_use_DP6 = false;
  651. int btnRight_CROSS_DP6_open_start_delay = 1; // in seconds (0 to 30)
  652. int btnRight_CROSS_DP6_stay_open_time = 5; // in seconds (1 to 30)
  653. // Dome Panel #7
  654. boolean btnRight_CROSS_use_DP7 = false;
  655. int btnRight_CROSS_DP7_open_start_delay = 1; // in seconds (0 to 30)
  656. int btnRight_CROSS_DP7_stay_open_time = 5; // in seconds (1 to 30)
  657. // Dome Panel #8
  658. boolean btnRight_CROSS_use_DP8 = false;
  659. int btnRight_CROSS_DP8_open_start_delay = 1; // in seconds (0 to 30)
  660. int btnRight_CROSS_DP8_stay_open_time = 5; // in seconds (1 to 30)
  661. // Dome Panel #9
  662. boolean btnRight_CROSS_use_DP9 = false;
  663. int btnRight_CROSS_DP9_open_start_delay = 1; // in seconds (0 to 30)
  664. int btnRight_CROSS_DP9_stay_open_time = 5; // in seconds (1 to 30)
  665. // Dome Panel #10
  666. boolean btnRight_CROSS_use_DP10 = false;
  667. int btnRight_CROSS_DP10_open_start_delay = 1; // in seconds (0 to 30)
  668. int btnRight_CROSS_DP10_stay_open_time = 5; // in seconds (1 to 30)
  669.  
  670. //---------------------------------
  671. // CONFIGURE: Arrow Down + CROSS
  672. //---------------------------------
  673. //1 = Std MarcDuino Function, 2 = Custom Function
  674. int btnDown_CROSS_type = 1;    
  675.  
  676. // IF Std MarcDuino Function (type=1)
  677. // Enter MarcDuino Function Code (1 - 78) (See Above)
  678. int btnDown_CROSS_MD_func = 27;
  679.  
  680. // IF Custom Function (type=2)
  681. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  682. // Valid values: 0 or 182 - 200  
  683. int btnDown_CROSS_cust_MP3_num = 0;  
  684.  
  685. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  686. // Valid values: 0, 1 to 8  (0 - Not used)
  687. int btnDown_CROSS_cust_LD_type = 0;
  688.  
  689. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  690. String btnDown_CROSS_cust_LD_text = "";
  691.  
  692. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  693. // Valid Values: 0, 1 to 9 (0 = Not used)
  694. int btnDown_CROSS_cust_panel = 0;
  695.  
  696. // IF Custom Panel Setting = 9 (custom panel sequence)
  697. // Dome Panel #1
  698. boolean btnDown_CROSS_use_DP1 = false;
  699. int btnDown_CROSS_DP1_open_start_delay = 1; // in seconds (0 to 30)
  700. int btnDown_CROSS_DP1_stay_open_time = 5; // in seconds (1 to 30)
  701. // Dome Panel #2
  702. boolean btnDown_CROSS_use_DP2 = false;
  703. int btnDown_CROSS_DP2_open_start_delay = 1; // in seconds (0 to 30)
  704. int btnDown_CROSS_DP2_stay_open_time = 5; // in seconds (1 to 30)
  705. // Dome Panel #3
  706. boolean btnDown_CROSS_use_DP3 = false;
  707. int btnDown_CROSS_DP3_open_start_delay = 1; // in seconds (0 to 30)
  708. int btnDown_CROSS_DP3_stay_open_time = 5; // in seconds (1 to 30)
  709. // Dome Panel #4
  710. boolean btnDown_CROSS_use_DP4 = false;
  711. int btnDown_CROSS_DP4_open_start_delay = 1; // in seconds (0 to 30)
  712. int btnDown_CROSS_DP4_stay_open_time = 5; // in seconds (1 to 30)
  713. // Dome Panel #5
  714. boolean btnDown_CROSS_use_DP5 = false;
  715. int btnDown_CROSS_DP5_open_start_delay = 1; // in seconds (0 to 30)
  716. int btnDown_CROSS_DP5_stay_open_time = 5; // in seconds (1 to 30)
  717. // Dome Panel #6
  718. boolean btnDown_CROSS_use_DP6 = false;
  719. int btnDown_CROSS_DP6_open_start_delay = 1; // in seconds (0 to 30)
  720. int btnDown_CROSS_DP6_stay_open_time = 5; // in seconds (1 to 30)
  721. // Dome Panel #7
  722. boolean btnDown_CROSS_use_DP7 = false;
  723. int btnDown_CROSS_DP7_open_start_delay = 1; // in seconds (0 to 30)
  724. int btnDown_CROSS_DP7_stay_open_time = 5; // in seconds (1 to 30)
  725. // Dome Panel #8
  726. boolean btnDown_CROSS_use_DP8 = false;
  727. int btnDown_CROSS_DP8_open_start_delay = 1; // in seconds (0 to 30)
  728. int btnDown_CROSS_DP8_stay_open_time = 5; // in seconds (1 to 30)
  729. // Dome Panel #9
  730. boolean btnDown_CROSS_use_DP9 = false;
  731. int btnDown_CROSS_DP9_open_start_delay = 1; // in seconds (0 to 30)
  732. int btnDown_CROSS_DP9_stay_open_time = 5; // in seconds (1 to 30)
  733. // Dome Panel #10
  734. boolean btnDown_CROSS_use_DP10 = false;
  735. int btnDown_CROSS_DP10_open_start_delay = 1; // in seconds (0 to 30)
  736. int btnDown_CROSS_DP10_stay_open_time = 5; // in seconds (1 to 30)
  737.  
  738. //---------------------------------
  739. // CONFIGURE: Arrow UP + CIRCLE
  740. //---------------------------------
  741. //1 = Std MarcDuino Function, 2 = Custom Function
  742. int btnUP_CIRCLE_type = 1;    
  743.  
  744. // IF Std MarcDuino Function (type=1)
  745. // Enter MarcDuino Function Code (1 - 78) (See Above)
  746. int btnUP_CIRCLE_MD_func = 2;
  747.  
  748. // IF Custom Function (type=2)
  749. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  750. // Valid values: 0 or 182 - 200  
  751. int btnUP_CIRCLE_cust_MP3_num = 0;  
  752.  
  753. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  754. // Valid values: 0, 1 to 8  (0 - Not used)
  755. int btnUP_CIRCLE_cust_LD_type = 0;
  756.  
  757. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  758. String btnUP_CIRCLE_cust_LD_text = "";
  759.  
  760. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  761. // Valid Values: 0, 1 to 9 (0 = Not used)
  762. int btnUP_CIRCLE_cust_panel = 0;
  763.  
  764. // IF Custom Panel Setting = 9 (custom panel sequence)
  765. // Dome Panel #1
  766. boolean btnUP_CIRCLE_use_DP1 = false;
  767. int btnUP_CIRCLE_DP1_open_start_delay = 1; // in seconds (0 to 30)
  768. int btnUP_CIRCLE_DP1_stay_open_time = 5; // in seconds (1 to 30)
  769. // Dome Panel #2
  770. boolean btnUP_CIRCLE_use_DP2 = false;
  771. int btnUP_CIRCLE_DP2_open_start_delay = 1; // in seconds (0 to 30)
  772. int btnUP_CIRCLE_DP2_stay_open_time = 5; // in seconds (1 to 30)
  773. // Dome Panel #3
  774. boolean btnUP_CIRCLE_use_DP3 = false;
  775. int btnUP_CIRCLE_DP3_open_start_delay = 1; // in seconds (0 to 30)
  776. int btnUP_CIRCLE_DP3_stay_open_time = 5; // in seconds (1 to 30)
  777. // Dome Panel #4
  778. boolean btnUP_CIRCLE_use_DP4 = false;
  779. int btnUP_CIRCLE_DP4_open_start_delay = 1; // in seconds (0 to 30)
  780. int btnUP_CIRCLE_DP4_stay_open_time = 5; // in seconds (1 to 30)
  781. // Dome Panel #5
  782. boolean btnUP_CIRCLE_use_DP5 = false;
  783. int btnUP_CIRCLE_DP5_open_start_delay = 1; // in seconds (0 to 30)
  784. int btnUP_CIRCLE_DP5_stay_open_time = 5; // in seconds (1 to 30)
  785. // Dome Panel #6
  786. boolean btnUP_CIRCLE_use_DP6 = false;
  787. int btnUP_CIRCLE_DP6_open_start_delay = 1; // in seconds (0 to 30)
  788. int btnUP_CIRCLE_DP6_stay_open_time = 5; // in seconds (1 to 30)
  789. // Dome Panel #7
  790. boolean btnUP_CIRCLE_use_DP7 = false;
  791. int btnUP_CIRCLE_DP7_open_start_delay = 1; // in seconds (0 to 30)
  792. int btnUP_CIRCLE_DP7_stay_open_time = 5; // in seconds (1 to 30)
  793. // Dome Panel #8
  794. boolean btnUP_CIRCLE_use_DP8 = false;
  795. int btnUP_CIRCLE_DP8_open_start_delay = 1; // in seconds (0 to 30)
  796. int btnUP_CIRCLE_DP8_stay_open_time = 5; // in seconds (1 to 30)
  797. // Dome Panel #9
  798. boolean btnUP_CIRCLE_use_DP9 = false;
  799. int btnUP_CIRCLE_DP9_open_start_delay = 1; // in seconds (0 to 30)
  800. int btnUP_CIRCLE_DP9_stay_open_time = 5; // in seconds (1 to 30)
  801. // Dome Panel #10
  802. boolean btnUP_CIRCLE_use_DP10 = false;
  803. int btnUP_CIRCLE_DP10_open_start_delay = 1; // in seconds (0 to 30)
  804. int btnUP_CIRCLE_DP10_stay_open_time = 5; // in seconds (1 to 30)
  805.  
  806. //---------------------------------
  807. // CONFIGURE: Arrow Left + CIRCLE
  808. //---------------------------------
  809. //1 = Std MarcDuino Function, 2 = Custom Function
  810. int btnLeft_CIRCLE_type = 1;    
  811.  
  812. // IF Std MarcDuino Function (type=1)
  813. // Enter MarcDuino Function Code (1 - 78) (See Above)
  814. int btnLeft_CIRCLE_MD_func = 4;
  815.  
  816. // IF Custom Function (type=2)
  817. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  818. // Valid values: 0 or 182 - 200  
  819. int btnLeft_CIRCLE_cust_MP3_num = 0;  
  820.  
  821. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  822. // Valid values: 0, 1 to 8  (0 - Not used)
  823. int btnLeft_CIRCLE_cust_LD_type = 0;
  824.  
  825. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  826. String btnLeft_CIRCLE_cust_LD_text = "";
  827.  
  828. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  829. // Valid Values: 0, 1 to 9 (0 = Not used)
  830. int btnLeft_CIRCLE_cust_panel = 0;
  831.  
  832. // IF Custom Panel Setting = 9 (custom panel sequence)
  833. // Dome Panel #1
  834. boolean btnLeft_CIRCLE_use_DP1 = false;
  835. int btnLeft_CIRCLE_DP1_open_start_delay = 1; // in seconds (0 to 30)
  836. int btnLeft_CIRCLE_DP1_stay_open_time = 5; // in seconds (1 to 30)
  837. // Dome Panel #2
  838. boolean btnLeft_CIRCLE_use_DP2 = false;
  839. int btnLeft_CIRCLE_DP2_open_start_delay = 1; // in seconds (0 to 30)
  840. int btnLeft_CIRCLE_DP2_stay_open_time = 5; // in seconds (1 to 30)
  841. // Dome Panel #3
  842. boolean btnLeft_CIRCLE_use_DP3 = false;
  843. int btnLeft_CIRCLE_DP3_open_start_delay = 1; // in seconds (0 to 30)
  844. int btnLeft_CIRCLE_DP3_stay_open_time = 5; // in seconds (1 to 30)
  845. // Dome Panel #4
  846. boolean btnLeft_CIRCLE_use_DP4 = false;
  847. int btnLeft_CIRCLE_DP4_open_start_delay = 1; // in seconds (0 to 30)
  848. int btnLeft_CIRCLE_DP4_stay_open_time = 5; // in seconds (1 to 30)
  849. // Dome Panel #5
  850. boolean btnLeft_CIRCLE_use_DP5 = false;
  851. int btnLeft_CIRCLE_DP5_open_start_delay = 1; // in seconds (0 to 30)
  852. int btnLeft_CIRCLE_DP5_stay_open_time = 5; // in seconds (1 to 30)
  853. // Dome Panel #6
  854. boolean btnLeft_CIRCLE_use_DP6 = false;
  855. int btnLeft_CIRCLE_DP6_open_start_delay = 1; // in seconds (0 to 30)
  856. int btnLeft_CIRCLE_DP6_stay_open_time = 5; // in seconds (1 to 30)
  857. // Dome Panel #7
  858. boolean btnLeft_CIRCLE_use_DP7 = false;
  859. int btnLeft_CIRCLE_DP7_open_start_delay = 1; // in seconds (0 to 30)
  860. int btnLeft_CIRCLE_DP7_stay_open_time = 5; // in seconds (1 to 30)
  861. // Dome Panel #8
  862. boolean btnLeft_CIRCLE_use_DP8 = false;
  863. int btnLeft_CIRCLE_DP8_open_start_delay = 1; // in seconds (0 to 30)
  864. int btnLeft_CIRCLE_DP8_stay_open_time = 5; // in seconds (1 to 30)
  865. // Dome Panel #9
  866. boolean btnLeft_CIRCLE_use_DP9 = false;
  867. int btnLeft_CIRCLE_DP9_open_start_delay = 1; // in seconds (0 to 30)
  868. int btnLeft_CIRCLE_DP9_stay_open_time = 5; // in seconds (1 to 30)
  869. // Dome Panel #10
  870. boolean btnLeft_CIRCLE_use_DP10 = false;
  871. int btnLeft_CIRCLE_DP10_open_start_delay = 1; // in seconds (0 to 30)
  872. int btnLeft_CIRCLE_DP10_stay_open_time = 5; // in seconds (1 to 30)
  873.  
  874. //---------------------------------
  875. // CONFIGURE: Arrow Right + CIRCLE
  876. //---------------------------------
  877. //1 = Std MarcDuino Function, 2 = Custom Function
  878. int btnRight_CIRCLE_type = 1;    
  879.  
  880. // IF Std MarcDuino Function (type=1)
  881. // Enter MarcDuino Function Code (1 - 78) (See Above)
  882. int btnRight_CIRCLE_MD_func = 7;
  883.  
  884. // IF Custom Function (type=2)
  885. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  886. // Valid values: 0 or 182 - 200  
  887. int btnRight_CIRCLE_cust_MP3_num = 0;  
  888.  
  889. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  890. // Valid values: 0, 1 to 8  (0 - Not used)
  891. int btnRight_CIRCLE_cust_LD_type = 0;
  892.  
  893. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  894. String btnRight_CIRCLE_cust_LD_text = "";
  895.  
  896. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  897. // Valid Values: 0, 1 to 9 (0 = Not used)
  898. int btnRight_CIRCLE_cust_panel = 0;
  899.  
  900. // IF Custom Panel Setting = 9 (custom panel sequence)
  901. // Dome Panel #1
  902. boolean btnRight_CIRCLE_use_DP1 = false;
  903. int btnRight_CIRCLE_DP1_open_start_delay = 1; // in seconds (0 to 30)
  904. int btnRight_CIRCLE_DP1_stay_open_time = 5; // in seconds (1 to 30)
  905. // Dome Panel #2
  906. boolean btnRight_CIRCLE_use_DP2 = false;
  907. int btnRight_CIRCLE_DP2_open_start_delay = 1; // in seconds (0 to 30)
  908. int btnRight_CIRCLE_DP2_stay_open_time = 5; // in seconds (1 to 30)
  909. // Dome Panel #3
  910. boolean btnRight_CIRCLE_use_DP3 = false;
  911. int btnRight_CIRCLE_DP3_open_start_delay = 1; // in seconds (0 to 30)
  912. int btnRight_CIRCLE_DP3_stay_open_time = 5; // in seconds (1 to 30)
  913. // Dome Panel #4
  914. boolean btnRight_CIRCLE_use_DP4 = false;
  915. int btnRight_CIRCLE_DP4_open_start_delay = 1; // in seconds (0 to 30)
  916. int btnRight_CIRCLE_DP4_stay_open_time = 5; // in seconds (1 to 30)
  917. // Dome Panel #5
  918. boolean btnRight_CIRCLE_use_DP5 = false;
  919. int btnRight_CIRCLE_DP5_open_start_delay = 1; // in seconds (0 to 30)
  920. int btnRight_CIRCLE_DP5_stay_open_time = 5; // in seconds (1 to 30)
  921. // Dome Panel #6
  922. boolean btnRight_CIRCLE_use_DP6 = false;
  923. int btnRight_CIRCLE_DP6_open_start_delay = 1; // in seconds (0 to 30)
  924. int btnRight_CIRCLE_DP6_stay_open_time = 5; // in seconds (1 to 30)
  925. // Dome Panel #7
  926. boolean btnRight_CIRCLE_use_DP7 = false;
  927. int btnRight_CIRCLE_DP7_open_start_delay = 1; // in seconds (0 to 30)
  928. int btnRight_CIRCLE_DP7_stay_open_time = 5; // in seconds (1 to 30)
  929. // Dome Panel #8
  930. boolean btnRight_CIRCLE_use_DP8 = false;
  931. int btnRight_CIRCLE_DP8_open_start_delay = 1; // in seconds (0 to 30)
  932. int btnRight_CIRCLE_DP8_stay_open_time = 5; // in seconds (1 to 30)
  933. // Dome Panel #9
  934. boolean btnRight_CIRCLE_use_DP9 = false;
  935. int btnRight_CIRCLE_DP9_open_start_delay = 1; // in seconds (0 to 30)
  936. int btnRight_CIRCLE_DP9_stay_open_time = 5; // in seconds (1 to 30)
  937. // Dome Panel #10
  938. boolean btnRight_CIRCLE_use_DP10 = false;
  939. int btnRight_CIRCLE_DP10_open_start_delay = 1; // in seconds (0 to 30)
  940. int btnRight_CIRCLE_DP10_stay_open_time = 5; // in seconds (1 to 30)
  941.  
  942. //---------------------------------
  943. // CONFIGURE: Arrow Down + CIRCLE
  944. //---------------------------------
  945. //1 = Std MarcDuino Function, 2 = Custom Function
  946. int btnDown_CIRCLE_type = 1;    
  947.  
  948. // IF Std MarcDuino Function (type=1)
  949. // Enter MarcDuino Function Code (1 - 78) (See Above)
  950. int btnDown_CIRCLE_MD_func = 10;
  951.  
  952. // IF Custom Function (type=2)
  953. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  954. // Valid values: 0 or 182 - 200  
  955. int btnDown_CIRCLE_cust_MP3_num = 0;  
  956.  
  957. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  958. // Valid values: 0, 1 to 8  (0 - Not used)
  959. int btnDown_CIRCLE_cust_LD_type = 0;
  960.  
  961. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  962. String btnDown_CIRCLE_cust_LD_text = "";
  963.  
  964. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  965. // Valid Values: 0, 1 to 9 (0 = Not used)
  966. int btnDown_CIRCLE_cust_panel = 0;
  967.  
  968. // IF Custom Panel Setting = 9 (custom panel sequence)
  969. // Dome Panel #1
  970. boolean btnDown_CIRCLE_use_DP1 = false;
  971. int btnDown_CIRCLE_DP1_open_start_delay = 1; // in seconds (0 to 30)
  972. int btnDown_CIRCLE_DP1_stay_open_time = 5; // in seconds (1 to 30)
  973. // Dome Panel #2
  974. boolean btnDown_CIRCLE_use_DP2 = false;
  975. int btnDown_CIRCLE_DP2_open_start_delay = 1; // in seconds (0 to 30)
  976. int btnDown_CIRCLE_DP2_stay_open_time = 5; // in seconds (1 to 30)
  977. // Dome Panel #3
  978. boolean btnDown_CIRCLE_use_DP3 = false;
  979. int btnDown_CIRCLE_DP3_open_start_delay = 1; // in seconds (0 to 30)
  980. int btnDown_CIRCLE_DP3_stay_open_time = 5; // in seconds (1 to 30)
  981. // Dome Panel #4
  982. boolean btnDown_CIRCLE_use_DP4 = false;
  983. int btnDown_CIRCLE_DP4_open_start_delay = 1; // in seconds (0 to 30)
  984. int btnDown_CIRCLE_DP4_stay_open_time = 5; // in seconds (1 to 30)
  985. // Dome Panel #5
  986. boolean btnDown_CIRCLE_use_DP5 = false;
  987. int btnDown_CIRCLE_DP5_open_start_delay = 1; // in seconds (0 to 30)
  988. int btnDown_CIRCLE_DP5_stay_open_time = 5; // in seconds (1 to 30)
  989. // Dome Panel #6
  990. boolean btnDown_CIRCLE_use_DP6 = false;
  991. int btnDown_CIRCLE_DP6_open_start_delay = 1; // in seconds (0 to 30)
  992. int btnDown_CIRCLE_DP6_stay_open_time = 5; // in seconds (1 to 30)
  993. // Dome Panel #7
  994. boolean btnDown_CIRCLE_use_DP7 = false;
  995. int btnDown_CIRCLE_DP7_open_start_delay = 1; // in seconds (0 to 30)
  996. int btnDown_CIRCLE_DP7_stay_open_time = 5; // in seconds (1 to 30)
  997. // Dome Panel #8
  998. boolean btnDown_CIRCLE_use_DP8 = false;
  999. int btnDown_CIRCLE_DP8_open_start_delay = 1; // in seconds (0 to 30)
  1000. int btnDown_CIRCLE_DP8_stay_open_time = 5; // in seconds (1 to 30)
  1001. // Dome Panel #9
  1002. boolean btnDown_CIRCLE_use_DP9 = false;
  1003. int btnDown_CIRCLE_DP9_open_start_delay = 1; // in seconds (0 to 30)
  1004. int btnDown_CIRCLE_DP9_stay_open_time = 5; // in seconds (1 to 30)
  1005. // Dome Panel #10
  1006. boolean btnDown_CIRCLE_use_DP10 = false;
  1007. int btnDown_CIRCLE_DP10_open_start_delay = 1; // in seconds (0 to 30)
  1008. int btnDown_CIRCLE_DP10_stay_open_time = 5; // in seconds (1 to 30)
  1009.  
  1010. //---------------------------------
  1011. // CONFIGURE: Arrow UP + PS
  1012. //---------------------------------
  1013. //1 = Std MarcDuino Function, 2 = Custom Function
  1014. int btnUP_PS_type = 2;    
  1015.  
  1016. // IF Std MarcDuino Function (type=1)
  1017. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1018. int btnUP_PS_MD_func = 0;
  1019.  
  1020. // IF Custom Function (type=2)
  1021. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  1022. // Valid values: 0 or 182 - 200  
  1023. int btnUP_PS_cust_MP3_num = 183;  
  1024.  
  1025. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  1026. // Valid values: 0, 1 to 8  (0 - Not used)
  1027. int btnUP_PS_cust_LD_type = 5;
  1028.  
  1029. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  1030. String btnUP_PS_cust_LD_text = "";
  1031.  
  1032. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  1033. // Valid Values: 0, 1 to 9 (0 = Not used)
  1034. int btnUP_PS_cust_panel = 0;
  1035.  
  1036. // IF Custom Panel Setting = 9 (custom panel sequence)
  1037. // Dome Panel #1
  1038. boolean btnUP_PS_use_DP1 = false;
  1039. int btnUP_PS_DP1_open_start_delay = 1; // in seconds (0 to 30)
  1040. int btnUP_PS_DP1_stay_open_time = 5; // in seconds (1 to 30)
  1041. // Dome Panel #2
  1042. boolean btnUP_PS_use_DP2 = false;
  1043. int btnUP_PS_DP2_open_start_delay = 1; // in seconds (0 to 30)
  1044. int btnUP_PS_DP2_stay_open_time = 5; // in seconds (1 to 30)
  1045. // Dome Panel #3
  1046. boolean btnUP_PS_use_DP3 = false;
  1047. int btnUP_PS_DP3_open_start_delay = 1; // in seconds (0 to 30)
  1048. int btnUP_PS_DP3_stay_open_time = 5; // in seconds (1 to 30)
  1049. // Dome Panel #4
  1050. boolean btnUP_PS_use_DP4 = false;
  1051. int btnUP_PS_DP4_open_start_delay = 1; // in seconds (0 to 30)
  1052. int btnUP_PS_DP4_stay_open_time = 5; // in seconds (1 to 30)
  1053. // Dome Panel #5
  1054. boolean btnUP_PS_use_DP5 = false;
  1055. int btnUP_PS_DP5_open_start_delay = 1; // in seconds (0 to 30)
  1056. int btnUP_PS_DP5_stay_open_time = 5; // in seconds (1 to 30)
  1057. // Dome Panel #6
  1058. boolean btnUP_PS_use_DP6 = false;
  1059. int btnUP_PS_DP6_open_start_delay = 1; // in seconds (0 to 30)
  1060. int btnUP_PS_DP6_stay_open_time = 5; // in seconds (1 to 30)
  1061. // Dome Panel #7
  1062. boolean btnUP_PS_use_DP7 = false;
  1063. int btnUP_PS_DP7_open_start_delay = 1; // in seconds (0 to 30)
  1064. int btnUP_PS_DP7_stay_open_time = 5; // in seconds (1 to 30)
  1065. // Dome Panel #8
  1066. boolean btnUP_PS_use_DP8 = false;
  1067. int btnUP_PS_DP8_open_start_delay = 1; // in seconds (0 to 30)
  1068. int btnUP_PS_DP8_stay_open_time = 5; // in seconds (1 to 30)
  1069. // Dome Panel #9
  1070. boolean btnUP_PS_use_DP9 = false;
  1071. int btnUP_PS_DP9_open_start_delay = 1; // in seconds (0 to 30)
  1072. int btnUP_PS_DP9_stay_open_time = 5; // in seconds (1 to 30)
  1073. // Dome Panel #10
  1074. boolean btnUP_PS_use_DP10 = false;
  1075. int btnUP_PS_DP10_open_start_delay = 1; // in seconds (0 to 30)
  1076. int btnUP_PS_DP10_stay_open_time = 5; // in seconds (1 to 30)
  1077.  
  1078. //---------------------------------
  1079. // CONFIGURE: Arrow Left + PS
  1080. //---------------------------------
  1081. //1 = Std MarcDuino Function, 2 = Custom Function
  1082. int btnLeft_PS_type = 2;    
  1083.  
  1084. // IF Std MarcDuino Function (type=1)
  1085. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1086. int btnLeft_PS_MD_func = 0;
  1087.  
  1088. // IF Custom Function (type=2)
  1089. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  1090. // Valid values: 0 or 182 - 200  
  1091. int btnLeft_PS_cust_MP3_num = 186;  
  1092.  
  1093. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  1094. // Valid values: 0, 1 to 8  (0 - Not used)
  1095. int btnLeft_PS_cust_LD_type = 1;
  1096.  
  1097. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  1098. String btnLeft_PS_cust_LD_text = "";
  1099.  
  1100. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  1101. // Valid Values: 0, 1 to 9 (0 = Not used)
  1102. int btnLeft_PS_cust_panel = 0;
  1103.  
  1104. // IF Custom Panel Setting = 9 (custom panel sequence)
  1105. // Dome Panel #1
  1106. boolean btnLeft_PS_use_DP1 = false;
  1107. int btnLeft_PS_DP1_open_start_delay = 1; // in seconds (0 to 30)
  1108. int btnLeft_PS_DP1_stay_open_time = 5; // in seconds (1 to 30)
  1109. // Dome Panel #2
  1110. boolean btnLeft_PS_use_DP2 = false;
  1111. int btnLeft_PS_DP2_open_start_delay = 1; // in seconds (0 to 30)
  1112. int btnLeft_PS_DP2_stay_open_time = 5; // in seconds (1 to 30)
  1113. // Dome Panel #3
  1114. boolean btnLeft_PS_use_DP3 = false;
  1115. int btnLeft_PS_DP3_open_start_delay = 1; // in seconds (0 to 30)
  1116. int btnLeft_PS_DP3_stay_open_time = 5; // in seconds (1 to 30)
  1117. // Dome Panel #4
  1118. boolean btnLeft_PS_use_DP4 = false;
  1119. int btnLeft_PS_DP4_open_start_delay = 1; // in seconds (0 to 30)
  1120. int btnLeft_PS_DP4_stay_open_time = 5; // in seconds (1 to 30)
  1121. // Dome Panel #5
  1122. boolean btnLeft_PS_use_DP5 = false;
  1123. int btnLeft_PS_DP5_open_start_delay = 1; // in seconds (0 to 30)
  1124. int btnLeft_PS_DP5_stay_open_time = 5; // in seconds (1 to 30)
  1125. // Dome Panel #6
  1126. boolean btnLeft_PS_use_DP6 = false;
  1127. int btnLeft_PS_DP6_open_start_delay = 1; // in seconds (0 to 30)
  1128. int btnLeft_PS_DP6_stay_open_time = 5; // in seconds (1 to 30)
  1129. // Dome Panel #7
  1130. boolean btnLeft_PS_use_DP7 = false;
  1131. int btnLeft_PS_DP7_open_start_delay = 1; // in seconds (0 to 30)
  1132. int btnLeft_PS_DP7_stay_open_time = 5; // in seconds (1 to 30)
  1133. // Dome Panel #8
  1134. boolean btnLeft_PS_use_DP8 = false;
  1135. int btnLeft_PS_DP8_open_start_delay = 1; // in seconds (0 to 30)
  1136. int btnLeft_PS_DP8_stay_open_time = 5; // in seconds (1 to 30)
  1137. // Dome Panel #9
  1138. boolean btnLeft_PS_use_DP9 = false;
  1139. int btnLeft_PS_DP9_open_start_delay = 1; // in seconds (0 to 30)
  1140. int btnLeft_PS_DP9_stay_open_time = 5; // in seconds (1 to 30)
  1141. // Dome Panel #10
  1142. boolean btnLeft_PS_use_DP10 = false;
  1143. int btnLeft_PS_DP10_open_start_delay = 1; // in seconds (0 to 30)
  1144. int btnLeft_PS_DP10_stay_open_time = 5; // in seconds (1 to 30)
  1145.  
  1146. //---------------------------------
  1147. // CONFIGURE: Arrow Right + PS
  1148. //---------------------------------
  1149. //1 = Std MarcDuino Function, 2 = Custom Function
  1150. int btnRight_PS_type = 2;    
  1151.  
  1152. // IF Std MarcDuino Function (type=1)
  1153. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1154. int btnRight_PS_MD_func = 0;
  1155.  
  1156. // IF Custom Function (type=2)
  1157. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  1158. // Valid values: 0 or 182 - 200  
  1159. int btnRight_PS_cust_MP3_num = 185;  
  1160.  
  1161. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  1162. // Valid values: 0, 1 to 8  (0 - Not used)
  1163. int btnRight_PS_cust_LD_type = 1;
  1164.  
  1165. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  1166. String btnRight_PS_cust_LD_text = "";
  1167.  
  1168. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  1169. // Valid Values: 0, 1 to 9 (0 = Not used)
  1170. int btnRight_PS_cust_panel = 0;
  1171.  
  1172. // IF Custom Panel Setting = 9 (custom panel sequence)
  1173. // Dome Panel #1
  1174. boolean btnRight_PS_use_DP1 = false;
  1175. int btnRight_PS_DP1_open_start_delay = 1; // in seconds (0 to 30)
  1176. int btnRight_PS_DP1_stay_open_time = 5; // in seconds (1 to 30)
  1177. // Dome Panel #2
  1178. boolean btnRight_PS_use_DP2 = false;
  1179. int btnRight_PS_DP2_open_start_delay = 1; // in seconds (0 to 30)
  1180. int btnRight_PS_DP2_stay_open_time = 5; // in seconds (1 to 30)
  1181. // Dome Panel #3
  1182. boolean btnRight_PS_use_DP3 = false;
  1183. int btnRight_PS_DP3_open_start_delay = 1; // in seconds (0 to 30)
  1184. int btnRight_PS_DP3_stay_open_time = 5; // in seconds (1 to 30)
  1185. // Dome Panel #4
  1186. boolean btnRight_PS_use_DP4 = false;
  1187. int btnRight_PS_DP4_open_start_delay = 1; // in seconds (0 to 30)
  1188. int btnRight_PS_DP4_stay_open_time = 5; // in seconds (1 to 30)
  1189. // Dome Panel #5
  1190. boolean btnRight_PS_use_DP5 = false;
  1191. int btnRight_PS_DP5_open_start_delay = 1; // in seconds (0 to 30)
  1192. int btnRight_PS_DP5_stay_open_time = 5; // in seconds (1 to 30)
  1193. // Dome Panel #6
  1194. boolean btnRight_PS_use_DP6 = false;
  1195. int btnRight_PS_DP6_open_start_delay = 1; // in seconds (0 to 30)
  1196. int btnRight_PS_DP6_stay_open_time = 5; // in seconds (1 to 30)
  1197. // Dome Panel #7
  1198. boolean btnRight_PS_use_DP7 = false;
  1199. int btnRight_PS_DP7_open_start_delay = 1; // in seconds (0 to 30)
  1200. int btnRight_PS_DP7_stay_open_time = 5; // in seconds (1 to 30)
  1201. // Dome Panel #8
  1202. boolean btnRight_PS_use_DP8 = false;
  1203. int btnRight_PS_DP8_open_start_delay = 1; // in seconds (0 to 30)
  1204. int btnRight_PS_DP8_stay_open_time = 5; // in seconds (1 to 30)
  1205. // Dome Panel #9
  1206. boolean btnRight_PS_use_DP9 = false;
  1207. int btnRight_PS_DP9_open_start_delay = 1; // in seconds (0 to 30)
  1208. int btnRight_PS_DP9_stay_open_time = 5; // in seconds (1 to 30)
  1209. // Dome Panel #10
  1210. boolean btnRight_PS_use_DP10 = false;
  1211. int btnRight_PS_DP10_open_start_delay = 1; // in seconds (0 to 30)
  1212. int btnRight_PS_DP10_stay_open_time = 5; // in seconds (1 to 30)
  1213.  
  1214. //---------------------------------
  1215. // CONFIGURE: Arrow Down + PS
  1216. //---------------------------------
  1217. //1 = Std MarcDuino Function, 2 = Custom Function
  1218. int btnDown_PS_type = 2;    
  1219.  
  1220. // IF Std MarcDuino Function (type=1)
  1221. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1222. int btnDown_PS_MD_func = 0;
  1223.  
  1224. // IF Custom Function (type=2)
  1225. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  1226. // Valid values: 0 or 182 - 200  
  1227. int btnDown_PS_cust_MP3_num = 184;  
  1228.  
  1229. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  1230. // Valid values: 0, 1 to 8  (0 - Not used)
  1231. int btnDown_PS_cust_LD_type = 1;
  1232.  
  1233. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  1234. String btnDown_PS_cust_LD_text = "";
  1235.  
  1236. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  1237. // Valid Values: 0, 1 to 9 (0 = Not used)
  1238. int btnDown_PS_cust_panel = 0;
  1239.  
  1240. // IF Custom Panel Setting = 9 (custom panel sequence)
  1241. // Dome Panel #1
  1242. boolean btnDown_PS_use_DP1 = false;
  1243. int btnDown_PS_DP1_open_start_delay = 1; // in seconds (0 to 30)
  1244. int btnDown_PS_DP1_stay_open_time = 5; // in seconds (1 to 30)
  1245. // Dome Panel #2
  1246. boolean btnDown_PS_use_DP2 = false;
  1247. int btnDown_PS_DP2_open_start_delay = 1; // in seconds (0 to 30)
  1248. int btnDown_PS_DP2_stay_open_time = 5; // in seconds (1 to 30)
  1249. // Dome Panel #3
  1250. boolean btnDown_PS_use_DP3 = false;
  1251. int btnDown_PS_DP3_open_start_delay = 1; // in seconds (0 to 30)
  1252. int btnDown_PS_DP3_stay_open_time = 5; // in seconds (1 to 30)
  1253. // Dome Panel #4
  1254. boolean btnDown_PS_use_DP4 = false;
  1255. int btnDown_PS_DP4_open_start_delay = 1; // in seconds (0 to 30)
  1256. int btnDown_PS_DP4_stay_open_time = 5; // in seconds (1 to 30)
  1257. // Dome Panel #5
  1258. boolean btnDown_PS_use_DP5 = false;
  1259. int btnDown_PS_DP5_open_start_delay = 1; // in seconds (0 to 30)
  1260. int btnDown_PS_DP5_stay_open_time = 5; // in seconds (1 to 30)
  1261. // Dome Panel #6
  1262. boolean btnDown_PS_use_DP6 = false;
  1263. int btnDown_PS_DP6_open_start_delay = 1; // in seconds (0 to 30)
  1264. int btnDown_PS_DP6_stay_open_time = 5; // in seconds (1 to 30)
  1265. // Dome Panel #7
  1266. boolean btnDown_PS_use_DP7 = false;
  1267. int btnDown_PS_DP7_open_start_delay = 1; // in seconds (0 to 30)
  1268. int btnDown_PS_DP7_stay_open_time = 5; // in seconds (1 to 30)
  1269. // Dome Panel #8
  1270. boolean btnDown_PS_use_DP8 = false;
  1271. int btnDown_PS_DP8_open_start_delay = 1; // in seconds (0 to 30)
  1272. int btnDown_PS_DP8_stay_open_time = 5; // in seconds (1 to 30)
  1273. // Dome Panel #9
  1274. boolean btnDown_PS_use_DP9 = false;
  1275. int btnDown_PS_DP9_open_start_delay = 1; // in seconds (0 to 30)
  1276. int btnDown_PS_DP9_stay_open_time = 5; // in seconds (1 to 30)
  1277. // Dome Panel #10
  1278. boolean btnDown_PS_use_DP10 = false;
  1279. int btnDown_PS_DP10_open_start_delay = 1; // in seconds (0 to 30)
  1280. int btnDown_PS_DP10_stay_open_time = 5; // in seconds (1 to 30)
  1281.  
  1282. //---------------------------------
  1283. // CONFIGURE: Arrow Up + L1
  1284. //---------------------------------
  1285. //1 = Std MarcDuino Function, 2 = Custom Function
  1286. int btnUP_L1_type = 1;    
  1287.  
  1288. // IF Std MarcDuino Function (type=1)
  1289. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1290. int btnUP_L1_MD_func = 8;
  1291.  
  1292. // IF Custom Function (type=2)
  1293. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  1294. // Valid values: 0 or 182 - 200  
  1295. int btnUP_L1_cust_MP3_num = 0;  
  1296.  
  1297. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  1298. // Valid values: 0, 1 to 8  (0 - Not used)
  1299. int btnUP_L1_cust_LD_type = 0;
  1300.  
  1301. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  1302. String btnUP_L1_cust_LD_text = "";
  1303.  
  1304. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  1305. // Valid Values: 0, 1 to 9 (0 = Not used)
  1306. int btnUP_L1_cust_panel = 0;
  1307.  
  1308. // IF Custom Panel Setting = 9 (custom panel sequence)
  1309. // Dome Panel #1
  1310. boolean btnUP_L1_use_DP1 = false;
  1311. int btnUP_L1_DP1_open_start_delay = 1; // in seconds (0 to 30)
  1312. int btnUP_L1_DP1_stay_open_time = 5; // in seconds (1 to 30)
  1313. // Dome Panel #2
  1314. boolean btnUP_L1_use_DP2 = false;
  1315. int btnUP_L1_DP2_open_start_delay = 1; // in seconds (0 to 30)
  1316. int btnUP_L1_DP2_stay_open_time = 5; // in seconds (1 to 30)
  1317. // Dome Panel #3
  1318. boolean btnUP_L1_use_DP3 = false;
  1319. int btnUP_L1_DP3_open_start_delay = 1; // in seconds (0 to 30)
  1320. int btnUP_L1_DP3_stay_open_time = 5; // in seconds (1 to 30)
  1321. // Dome Panel #4
  1322. boolean btnUP_L1_use_DP4 = false;
  1323. int btnUP_L1_DP4_open_start_delay = 1; // in seconds (0 to 30)
  1324. int btnUP_L1_DP4_stay_open_time = 5; // in seconds (1 to 30)
  1325. // Dome Panel #5
  1326. boolean btnUP_L1_use_DP5 = false;
  1327. int btnUP_L1_DP5_open_start_delay = 1; // in seconds (0 to 30)
  1328. int btnUP_L1_DP5_stay_open_time = 5; // in seconds (1 to 30)
  1329. // Dome Panel #6
  1330. boolean btnUP_L1_use_DP6 = false;
  1331. int btnUP_L1_DP6_open_start_delay = 1; // in seconds (0 to 30)
  1332. int btnUP_L1_DP6_stay_open_time = 5; // in seconds (1 to 30)
  1333. // Dome Panel #7
  1334. boolean btnUP_L1_use_DP7 = false;
  1335. int btnUP_L1_DP7_open_start_delay = 1; // in seconds (0 to 30)
  1336. int btnUP_L1_DP7_stay_open_time = 5; // in seconds (1 to 30)
  1337. // Dome Panel #8
  1338. boolean btnUP_L1_use_DP8 = false;
  1339. int btnUP_L1_DP8_open_start_delay = 1; // in seconds (0 to 30)
  1340. int btnUP_L1_DP8_stay_open_time = 5; // in seconds (1 to 30)
  1341. // Dome Panel #9
  1342. boolean btnUP_L1_use_DP9 = false;
  1343. int btnUP_L1_DP9_open_start_delay = 1; // in seconds (0 to 30)
  1344. int btnUP_L1_DP9_stay_open_time = 5; // in seconds (1 to 30)
  1345. // Dome Panel #10
  1346. boolean btnUP_L1_use_DP10 = false;
  1347. int btnUP_L1_DP10_open_start_delay = 1; // in seconds (0 to 30)
  1348. int btnUP_L1_DP10_stay_open_time = 5; // in seconds (1 to 30)
  1349.  
  1350. //---------------------------------
  1351. // CONFIGURE: Arrow Left + L1
  1352. //---------------------------------
  1353. //1 = Std MarcDuino Function, 2 = Custom Function
  1354. int btnLeft_L1_type = 1;    
  1355.  
  1356. // IF Std MarcDuino Function (type=1)
  1357. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1358. int btnLeft_L1_MD_func = 3;
  1359.  
  1360. // IF Custom Function (type=2)
  1361. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  1362. // Valid values: 0 or 182 - 200  
  1363. int btnLeft_L1_cust_MP3_num = 0;  
  1364.  
  1365. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  1366. // Valid values: 0, 1 to 8  (0 - Not used)
  1367. int btnLeft_L1_cust_LD_type = 0;
  1368.  
  1369. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  1370. String btnLeft_L1_cust_LD_text = "";
  1371.  
  1372. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  1373. // Valid Values: 0, 1 to 9 (0 = Not used)
  1374. int btnLeft_L1_cust_panel = 0;
  1375.  
  1376. // IF Custom Panel Setting = 9 (custom panel sequence)
  1377. // Dome Panel #1
  1378. boolean btnLeft_L1_use_DP1 = false;
  1379. int btnLeft_L1_DP1_open_start_delay = 1; // in seconds (0 to 30)
  1380. int btnLeft_L1_DP1_stay_open_time = 5; // in seconds (1 to 30)
  1381. // Dome Panel #2
  1382. boolean btnLeft_L1_use_DP2 = false;
  1383. int btnLeft_L1_DP2_open_start_delay = 1; // in seconds (0 to 30)
  1384. int btnLeft_L1_DP2_stay_open_time = 5; // in seconds (1 to 30)
  1385. // Dome Panel #3
  1386. boolean btnLeft_L1_use_DP3 = false;
  1387. int btnLeft_L1_DP3_open_start_delay = 1; // in seconds (0 to 30)
  1388. int btnLeft_L1_DP3_stay_open_time = 5; // in seconds (1 to 30)
  1389. // Dome Panel #4
  1390. boolean btnLeft_L1_use_DP4 = false;
  1391. int btnLeft_L1_DP4_open_start_delay = 1; // in seconds (0 to 30)
  1392. int btnLeft_L1_DP4_stay_open_time = 5; // in seconds (1 to 30)
  1393. // Dome Panel #5
  1394. boolean btnLeft_L1_use_DP5 = false;
  1395. int btnLeft_L1_DP5_open_start_delay = 1; // in seconds (0 to 30)
  1396. int btnLeft_L1_DP5_stay_open_time = 5; // in seconds (1 to 30)
  1397. // Dome Panel #6
  1398. boolean btnLeft_L1_use_DP6 = false;
  1399. int btnLeft_L1_DP6_open_start_delay = 1; // in seconds (0 to 30)
  1400. int btnLeft_L1_DP6_stay_open_time = 5; // in seconds (1 to 30)
  1401. // Dome Panel #7
  1402. boolean btnLeft_L1_use_DP7 = false;
  1403. int btnLeft_L1_DP7_open_start_delay = 1; // in seconds (0 to 30)
  1404. int btnLeft_L1_DP7_stay_open_time = 5; // in seconds (1 to 30)
  1405. // Dome Panel #8
  1406. boolean btnLeft_L1_use_DP8 = false;
  1407. int btnLeft_L1_DP8_open_start_delay = 1; // in seconds (0 to 30)
  1408. int btnLeft_L1_DP8_stay_open_time = 5; // in seconds (1 to 30)
  1409. // Dome Panel #9
  1410. boolean btnLeft_L1_use_DP9 = false;
  1411. int btnLeft_L1_DP9_open_start_delay = 1; // in seconds (0 to 30)
  1412. int btnLeft_L1_DP9_stay_open_time = 5; // in seconds (1 to 30)
  1413. // Dome Panel #10
  1414. boolean btnLeft_L1_use_DP10 = false;
  1415. int btnLeft_L1_DP10_open_start_delay = 1; // in seconds (0 to 30)
  1416. int btnLeft_L1_DP10_stay_open_time = 5; // in seconds (1 to 30)
  1417.  
  1418. //---------------------------------
  1419. // CONFIGURE: Arrow Right + L1
  1420. //---------------------------------
  1421. //1 = Std MarcDuino Function, 2 = Custom Function
  1422. int btnRight_L1_type = 1;    
  1423.  
  1424. // IF Std MarcDuino Function (type=1)
  1425. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1426. int btnRight_L1_MD_func = 5;
  1427.  
  1428. // IF Custom Function (type=2)
  1429. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  1430. // Valid values: 0 or 182 - 200  
  1431. int btnRight_L1_cust_MP3_num = 0;  
  1432.  
  1433. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  1434. // Valid values: 0, 1 to 8  (0 - Not used)
  1435. int btnRight_L1_cust_LD_type = 0;
  1436.  
  1437. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  1438. String btnRight_L1_cust_LD_text = "";
  1439.  
  1440. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  1441. // Valid Values: 0, 1 to 9 (0 = Not used)
  1442. int btnRight_L1_cust_panel = 0;
  1443.  
  1444. // IF Custom Panel Setting = 9 (custom panel sequence)
  1445. // Dome Panel #1
  1446. boolean btnRight_L1_use_DP1 = false;
  1447. int btnRight_L1_DP1_open_start_delay = 1; // in seconds (0 to 30)
  1448. int btnRight_L1_DP1_stay_open_time = 5; // in seconds (1 to 30)
  1449. // Dome Panel #2
  1450. boolean btnRight_L1_use_DP2 = false;
  1451. int btnRight_L1_DP2_open_start_delay = 1; // in seconds (0 to 30)
  1452. int btnRight_L1_DP2_stay_open_time = 5; // in seconds (1 to 30)
  1453. // Dome Panel #3
  1454. boolean btnRight_L1_use_DP3 = false;
  1455. int btnRight_L1_DP3_open_start_delay = 1; // in seconds (0 to 30)
  1456. int btnRight_L1_DP3_stay_open_time = 5; // in seconds (1 to 30)
  1457. // Dome Panel #4
  1458. boolean btnRight_L1_use_DP4 = false;
  1459. int btnRight_L1_DP4_open_start_delay = 1; // in seconds (0 to 30)
  1460. int btnRight_L1_DP4_stay_open_time = 5; // in seconds (1 to 30)
  1461. // Dome Panel #5
  1462. boolean btnRight_L1_use_DP5 = false;
  1463. int btnRight_L1_DP5_open_start_delay = 1; // in seconds (0 to 30)
  1464. int btnRight_L1_DP5_stay_open_time = 5; // in seconds (1 to 30)
  1465. // Dome Panel #6
  1466. boolean btnRight_L1_use_DP6 = false;
  1467. int btnRight_L1_DP6_open_start_delay = 1; // in seconds (0 to 30)
  1468. int btnRight_L1_DP6_stay_open_time = 5; // in seconds (1 to 30)
  1469. // Dome Panel #7
  1470. boolean btnRight_L1_use_DP7 = false;
  1471. int btnRight_L1_DP7_open_start_delay = 1; // in seconds (0 to 30)
  1472. int btnRight_L1_DP7_stay_open_time = 5; // in seconds (1 to 30)
  1473. // Dome Panel #8
  1474. boolean btnRight_L1_use_DP8 = false;
  1475. int btnRight_L1_DP8_open_start_delay = 1; // in seconds (0 to 30)
  1476. int btnRight_L1_DP8_stay_open_time = 5; // in seconds (1 to 30)
  1477. // Dome Panel #9
  1478. boolean btnRight_L1_use_DP9 = false;
  1479. int btnRight_L1_DP9_open_start_delay = 1; // in seconds (0 to 30)
  1480. int btnRight_L1_DP9_stay_open_time = 5; // in seconds (1 to 30)
  1481. // Dome Panel #10
  1482. boolean btnRight_L1_use_DP10 = false;
  1483. int btnRight_L1_DP10_open_start_delay = 1; // in seconds (0 to 30)
  1484. int btnRight_L1_DP10_stay_open_time = 5; // in seconds (1 to 30)
  1485.  
  1486. //---------------------------------
  1487. // CONFIGURE: Arrow Down + L1
  1488. //---------------------------------
  1489. //1 = Std MarcDuino Function, 2 = Custom Function
  1490. int btnDown_L1_type = 1;    
  1491.  
  1492. // IF Std MarcDuino Function (type=1)
  1493. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1494. int btnDown_L1_MD_func = 9;
  1495.  
  1496. // IF Custom Function (type=2)
  1497. // CUSTOM SOUND SETTING: Enter the file # prefix on the MP3 trigger card of the sound to play (0 = NO SOUND)
  1498. // Valid values: 0 or 182 - 200  
  1499. int btnDown_L1_cust_MP3_num = 0;  
  1500.  
  1501. // CUSTOM LOGIC DISPLAY SETTING: Pick from the Std MD Logic Display Functions (See Above)
  1502. // Valid values: 0, 1 to 8  (0 - Not used)
  1503. int btnDown_L1_cust_LD_type = 0;
  1504.  
  1505. // IF Custom Logic Display = 8 (custom text), enter custom display text here
  1506. String btnDown_L1_cust_LD_text = "";
  1507.  
  1508. // CUSTOM PANEL SETTING: Pick from the Std MD Panel Functions or Custom (See Above)
  1509. // Valid Values: 0, 1 to 9 (0 = Not used)
  1510. int btnDown_L1_cust_panel = 0;
  1511.  
  1512. // IF Custom Panel Setting = 9 (custom panel sequence)
  1513. // Dome Panel #1
  1514. boolean btnDown_L1_use_DP1 = false;
  1515. int btnDown_L1_DP1_open_start_delay = 1; // in seconds (0 to 30)
  1516. int btnDown_L1_DP1_stay_open_time = 5; // in seconds (1 to 30)
  1517. // Dome Panel #2
  1518. boolean btnDown_L1_use_DP2 = false;
  1519. int btnDown_L1_DP2_open_start_delay = 1; // in seconds (0 to 30)
  1520. int btnDown_L1_DP2_stay_open_time = 5; // in seconds (1 to 30)
  1521. // Dome Panel #3
  1522. boolean btnDown_L1_use_DP3 = false;
  1523. int btnDown_L1_DP3_open_start_delay = 1; // in seconds (0 to 30)
  1524. int btnDown_L1_DP3_stay_open_time = 5; // in seconds (1 to 30)
  1525. // Dome Panel #4
  1526. boolean btnDown_L1_use_DP4 = false;
  1527. int btnDown_L1_DP4_open_start_delay = 1; // in seconds (0 to 30)
  1528. int btnDown_L1_DP4_stay_open_time = 5; // in seconds (1 to 30)
  1529. // Dome Panel #5
  1530. boolean btnDown_L1_use_DP5 = false;
  1531. int btnDown_L1_DP5_open_start_delay = 1; // in seconds (0 to 30)
  1532. int btnDown_L1_DP5_stay_open_time = 5; // in seconds (1 to 30)
  1533. // Dome Panel #6
  1534. boolean btnDown_L1_use_DP6 = false;
  1535. int btnDown_L1_DP6_open_start_delay = 1; // in seconds (0 to 30)
  1536. int btnDown_L1_DP6_stay_open_time = 5; // in seconds (1 to 30)
  1537. // Dome Panel #7
  1538. boolean btnDown_L1_use_DP7 = false;
  1539. int btnDown_L1_DP7_open_start_delay = 1; // in seconds (0 to 30)
  1540. int btnDown_L1_DP7_stay_open_time = 5; // in seconds (1 to 30)
  1541. // Dome Panel #8
  1542. boolean btnDown_L1_use_DP8 = false;
  1543. int btnDown_L1_DP8_open_start_delay = 1; // in seconds (0 to 30)
  1544. int btnDown_L1_DP8_stay_open_time = 5; // in seconds (1 to 30)
  1545. // Dome Panel #9
  1546. boolean btnDown_L1_use_DP9 = false;
  1547. int btnDown_L1_DP9_open_start_delay = 1; // in seconds (0 to 30)
  1548. int btnDown_L1_DP9_stay_open_time = 5; // in seconds (1 to 30)
  1549. // Dome Panel #10
  1550. boolean btnDown_L1_use_DP10 = false;
  1551. int btnDown_L1_DP10_open_start_delay = 1; // in seconds (0 to 30)
  1552. int btnDown_L1_DP10_stay_open_time = 5; // in seconds (1 to 30)
  1553.  
  1554. //----------------------------------------------------
  1555. // CONFIGURE: The DOME Navigation Controller Buttons
  1556. //----------------------------------------------------
  1557.  
  1558. //---------------------------------
  1559. // CONFIGURE: Arrow Up
  1560. //---------------------------------
  1561. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1562. int FTbtnUP_MD_func = 58;
  1563.  
  1564. //---------------------------------
  1565. // CONFIGURE: Arrow Left
  1566. //---------------------------------
  1567. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1568. int FTbtnLeft_MD_func = 56;
  1569.  
  1570. //---------------------------------
  1571. // CONFIGURE: Arrow Right
  1572. //---------------------------------
  1573. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1574. int FTbtnRight_MD_func = 57;
  1575.  
  1576. //---------------------------------
  1577. // CONFIGURE: Arrow Down
  1578. //---------------------------------
  1579. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1580. int FTbtnDown_MD_func = 59;
  1581.  
  1582. //---------------------------------
  1583. // CONFIGURE: Arrow UP + CROSS
  1584. //---------------------------------
  1585. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1586. int FTbtnUP_CROSS_MD_func = 28;
  1587.  
  1588. //---------------------------------
  1589. // CONFIGURE: Arrow Left + CROSS
  1590. //---------------------------------
  1591. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1592. int FTbtnLeft_CROSS_MD_func = 33;
  1593.  
  1594. //---------------------------------
  1595. // CONFIGURE: Arrow Right + CROSS
  1596. //---------------------------------
  1597. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1598. int FTbtnRight_CROSS_MD_func = 30;
  1599.  
  1600. //---------------------------------
  1601. // CONFIGURE: Arrow Down + CROSS
  1602. //---------------------------------
  1603. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1604. int FTbtnDown_CROSS_MD_func = 29;
  1605.  
  1606. //---------------------------------
  1607. // CONFIGURE: Arrow UP + CIRCLE
  1608. //---------------------------------
  1609. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1610. int FTbtnUP_CIRCLE_MD_func = 22;
  1611.  
  1612. //---------------------------------
  1613. // CONFIGURE: Arrow Left + CIRCLE
  1614. //---------------------------------
  1615. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1616. int FTbtnLeft_CIRCLE_MD_func = 23;
  1617.  
  1618. //---------------------------------
  1619. // CONFIGURE: Arrow Right + CIRCLE
  1620. //---------------------------------
  1621. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1622. int FTbtnRight_CIRCLE_MD_func = 24;
  1623.  
  1624. //---------------------------------
  1625. // CONFIGURE: Arrow Down + CIRCLE
  1626. //---------------------------------
  1627. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1628. int FTbtnDown_CIRCLE_MD_func = 25;
  1629.  
  1630. //---------------------------------
  1631. // CONFIGURE: Arrow UP + PS
  1632. //---------------------------------
  1633. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1634. int FTbtnUP_PS_MD_func = 38;
  1635.  
  1636. //---------------------------------
  1637. // CONFIGURE: Arrow Left + PS
  1638. //---------------------------------
  1639. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1640. int FTbtnLeft_PS_MD_func = 40;
  1641.  
  1642. //---------------------------------
  1643. // CONFIGURE: Arrow Right + PS
  1644. //---------------------------------
  1645. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1646. int FTbtnRight_PS_MD_func = 41;
  1647.  
  1648. //---------------------------------
  1649. // CONFIGURE: Arrow Down + PS
  1650. //---------------------------------
  1651. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1652. int FTbtnDown_PS_MD_func = 39;
  1653.  
  1654. //---------------------------------
  1655. // CONFIGURE: Arrow Up + L1
  1656. //---------------------------------
  1657. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1658. int FTbtnUP_L1_MD_func = 34;
  1659.  
  1660. //---------------------------------
  1661. // CONFIGURE: Arrow Left + L1
  1662. //---------------------------------
  1663. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1664. int FTbtnLeft_L1_MD_func = 36;
  1665.  
  1666. //---------------------------------
  1667. // CONFIGURE: Arrow Right + L1
  1668. //---------------------------------
  1669. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1670. int FTbtnRight_L1_MD_func = 37;
  1671.  
  1672. //---------------------------------
  1673. // CONFIGURE: Arrow Down + L1
  1674. //---------------------------------
  1675. // Enter MarcDuino Function Code (1 - 78) (See Above)
  1676. int FTbtnDown_L1_MD_func = 35;
  1677.  
  1678. // ---------------------------------------------------------------------------------------
  1679. //               SYSTEM VARIABLES - USER CONFIG SECTION COMPLETED
  1680. // ---------------------------------------------------------------------------------------
  1681.  
  1682. // ---------------------------------------------------------------------------------------
  1683. //                          Drive Controller Settings
  1684. // ---------------------------------------------------------------------------------------
  1685.  
  1686. int motorControllerBaudRate = 9600; // Set the baud rate for the Syren motor controller
  1687.                                     // for packetized options are: 2400, 9600, 19200 and 38400
  1688.  
  1689. int marcDuinoBaudRate = 9600; // Set the baud rate for the Syren motor controller
  1690.                                    
  1691. #define SYREN_ADDR         129      // Serial Address for Dome Syren
  1692. #define SABERTOOTH_ADDR    128      // Serial Address for Foot Sabertooth
  1693.  
  1694. #define leftFootPin 44  //connect this pin to motor controller for left foot (R/C mode)
  1695. #define rightFootPin 45 //connect this pin to motor controller for right foot (R/C mode)
  1696. #define invertLeft 0    //if your foot motor is turning the wrong direction for some reason, change this from 0 to 1
  1697. #define invertRight 0
  1698. int footX,footY;
  1699.  
  1700. #define ENABLE_UHS_DEBUGGING 1
  1701.  
  1702. // ---------------------------------------------------------------------------------------
  1703. //                          Libraries
  1704. // ---------------------------------------------------------------------------------------
  1705. #include <PS3BT.h>
  1706. #include <usbhub.h>
  1707.  
  1708. // Satisfy IDE, which only needs to see the include statment in the ino.
  1709. #ifdef dobogusinclude
  1710. #include <spi4teensy3.h>
  1711. #endif
  1712.  
  1713. #include <Sabertooth.h>
  1714. #if FOOT_CONTROLLER == 1
  1715. #include <Servo.h>
  1716. #endif
  1717.  
  1718. // ---------------------------------------------------------------------------------------
  1719. //                    Panel Management Variables
  1720. // ---------------------------------------------------------------------------------------
  1721. boolean runningCustRoutine = false;
  1722.  
  1723. int DP1_Status = 0;  // 0 = closed, 1 = waiting to open, 2 = open
  1724. unsigned long DP1_start = 0;
  1725. int DP1_s_delay = 0;
  1726. int DP1_o_time = 0;
  1727.  
  1728. int DP2_Status = 0;  // 0 = closed, 1 = waiting to open, 2 = open
  1729. unsigned long DP2_start = 0;
  1730. int DP2_s_delay = 0;
  1731. int DP2_o_time = 0;
  1732.  
  1733. int DP3_Status = 0;  // 0 = closed, 1 = waiting to open, 2 = open
  1734. unsigned long DP3_start = 0;
  1735. int DP3_s_delay = 0;
  1736. int DP3_o_time = 0;
  1737.  
  1738. int DP4_Status = 0;  // 0 = closed, 1 = waiting to open, 2 = open
  1739. unsigned long DP4_start = 0;
  1740. int DP4_s_delay = 0;
  1741. int DP4_o_time = 0;
  1742.  
  1743. int DP5_Status = 0;  // 0 = closed, 1 = waiting to open, 2 = open
  1744. unsigned long DP5_start = 0;
  1745. int DP5_s_delay = 0;
  1746. int DP5_o_time = 0;
  1747.  
  1748. int DP6_Status = 0;  // 0 = closed, 1 = waiting to open, 2 = open
  1749. unsigned long DP6_start = 0;
  1750. int DP6_s_delay = 0;
  1751. int DP6_o_time = 0;
  1752.  
  1753. int DP7_Status = 0;  // 0 = closed, 1 = waiting to open, 2 = open
  1754. unsigned long DP7_start = 0;
  1755. int DP7_s_delay = 0;
  1756. int DP7_o_time = 0;
  1757.  
  1758. int DP8_Status = 0;  // 0 = closed, 1 = waiting to open, 2 = open
  1759. unsigned long DP8_start = 0;
  1760. int DP8_s_delay = 0;
  1761. int DP8_o_time = 0;
  1762.  
  1763. int DP9_Status = 0;  // 0 = closed, 1 = waiting to open, 2 = open
  1764. unsigned long DP9_start = 0;
  1765. int DP9_s_delay = 0;
  1766. int DP9_o_time = 0;
  1767.  
  1768. int DP10_Status = 0;  // 0 = closed, 1 = waiting to open, 2 = open
  1769. unsigned long DP10_start = 0;
  1770. int DP10_s_delay = 0;
  1771. int DP10_o_time = 0;
  1772.  
  1773. // ---------------------------------------------------------------------------------------
  1774. //                          Variables
  1775. // ---------------------------------------------------------------------------------------
  1776.  
  1777. long previousDomeMillis = millis();
  1778. long previousFootMillis = millis();
  1779. long previousMarcDuinoMillis = millis();
  1780. long previousDomeToggleMillis = millis();
  1781. long previousSpeedToggleMillis = millis();
  1782. long currentMillis = millis();
  1783.  
  1784. int serialLatency = 25;   //This is a delay factor in ms to prevent queueing of the Serial data.
  1785.                           //25ms seems approprate for HardwareSerial, values of 50ms or larger are needed for Softare Emulation
  1786.                          
  1787. int marcDuinoButtonCounter = 0;
  1788. int speedToggleButtonCounter = 0;
  1789. int domeToggleButtonCounter = 0;
  1790.  
  1791. #if FOOT_CONTROLLER == 0
  1792. Sabertooth *ST=new Sabertooth(SABERTOOTH_ADDR, Serial2); //
  1793. #endif
  1794. Sabertooth *SyR=new Sabertooth(SYREN_ADDR, Serial2);
  1795.  
  1796. ///////Setup for USB and Bluetooth Devices////////////////////////////
  1797. USB Usb;
  1798. BTD Btd(&Usb);
  1799. PS3BT *PS3NavFoot=new PS3BT(&Btd);
  1800. PS3BT *PS3NavDome=new PS3BT(&Btd);
  1801.  
  1802. //Used for PS3 Fault Detection
  1803. uint32_t msgLagTime = 0;
  1804. uint32_t lastMsgTime = 0;
  1805. uint32_t currentTime = 0;
  1806. uint32_t lastLoopTime = 0;
  1807. int badPS3Data = 0;
  1808. int badPS3DataDome = 0;
  1809.  
  1810. boolean firstMessage = true;
  1811. String output = "";
  1812.  
  1813. boolean isFootMotorStopped = true;
  1814. boolean isDomeMotorStopped = true;
  1815.  
  1816. boolean overSpeedSelected = false;
  1817.  
  1818. boolean isPS3NavigatonInitialized = false;
  1819. boolean isSecondaryPS3NavigatonInitialized = false;
  1820.  
  1821. boolean isStickEnabled = true;
  1822.  
  1823. boolean WaitingforReconnect = false;
  1824. boolean WaitingforReconnectDome = false;
  1825.  
  1826. boolean mainControllerConnected = false;
  1827. boolean domeControllerConnected = false;
  1828.  
  1829. // Dome Automation Variables
  1830. boolean domeAutomation = false;
  1831. int domeTurnDirection = 1;  // 1 = positive turn, -1 negative turn
  1832. float domeTargetPosition = 0; // (0 - 359) - degrees in a circle, 0 = home
  1833. unsigned long domeStopTurnTime = 0;    // millis() when next turn should stop
  1834. unsigned long domeStartTurnTime = 0;  // millis() when next turn should start
  1835. int domeStatus = 0;  // 0 = stopped, 1 = prepare to turn, 2 = turning
  1836.  
  1837. byte action = 0;
  1838. unsigned long DriveMillis = 0;
  1839.  
  1840. int footDriveSpeed = 0;
  1841.  
  1842. #if FOOT_CONTROLLER ==1
  1843. Servo leftFootSignal;
  1844. Servo rightFootSignal;
  1845. #endif
  1846.  
  1847. // =======================================================================================
  1848. //                          Main Program
  1849. // =======================================================================================
  1850.  
  1851.  
  1852. // =======================================================================================
  1853. //                          Initialize - Setup Function
  1854. // =======================================================================================
  1855. void setup()
  1856. {
  1857.     //Debug Serial for use with USB Debugging
  1858.     Serial.begin(115200);
  1859.     while (!Serial);
  1860.    
  1861.     if (Usb.Init() == -1)
  1862.     {
  1863.         Serial.print(F("\r\nOSC did not start"));
  1864.         while (1); //halt
  1865.     }
  1866.    
  1867.     Serial.print(F("\r\nBluetooth Library Started"));
  1868.    
  1869.     output.reserve(200); // Reserve 200 bytes for the output string
  1870.  
  1871.     //Setup for PS3
  1872.     PS3NavFoot->attachOnInit(onInitPS3NavFoot); // onInitPS3NavFoot is called upon a new connection
  1873.     PS3NavDome->attachOnInit(onInitPS3NavDome);
  1874.  
  1875.     //Setup for Serial2:: Motor Controllers - Sabertooth (Feet)
  1876.     Serial2.begin(motorControllerBaudRate);
  1877.     #if FOOT_CONTROLLER == 0
  1878.     ST->autobaud();          // Send the autobaud command to the Sabertooth controller(s).
  1879.     ST->setTimeout(10);      //DMB:  How low can we go for safety reasons?  multiples of 100ms
  1880.     ST->setDeadband(driveDeadBandRange);
  1881.     #elif FOOT_CONTROLLER == 1
  1882.     leftFootSignal.attach(leftFootPin);
  1883.     rightFootSignal.attach(rightFootPin);
  1884.     drivespeed1 = map(drivespeed1, 0, 127, 90, 180); //convert drivespeed values to something that will work for the Q85's
  1885.     drivespeed2 = map(drivespeed2, 0, 127, 90, 180);
  1886.     #endif
  1887.     stopFeet();
  1888.     SyR->autobaud();
  1889.     SyR->setTimeout(20);      //DMB:  How low can we go for safety reasons?  multiples of 100ms
  1890.     SyR->stop();
  1891.  
  1892.     //Setup for Serial1:: MarcDuino Dome Control Board
  1893.     Serial1.begin(marcDuinoBaudRate);
  1894.    
  1895.     //Setup for Serial3:: Optional MarcDuino Control Board for Body Panels
  1896.     Serial3.begin(marcDuinoBaudRate);
  1897.    
  1898.     randomSeed(analogRead(0));  // random number seed for dome automation  
  1899. }
  1900.  
  1901. // =======================================================================================
  1902. //           Main Program Loop - This is the recurring check loop for entire sketch
  1903. // =======================================================================================
  1904.  
  1905. void loop()
  1906. {  
  1907.     //Useful to enable with serial console when having controller issues.
  1908.     #ifdef TEST_CONROLLER
  1909.       testPS3Controller();
  1910.     #endif
  1911.  
  1912.     //LOOP through functions from highest to lowest priority.
  1913.  
  1914.     if ( !readUSB() )
  1915.     {
  1916.       //We have a fault condition that we want to ensure that we do NOT process any controller data!!!
  1917.       printOutput();
  1918.       return;
  1919.     }
  1920.    
  1921.     footMotorDrive();
  1922.     domeDrive();
  1923.     marcDuinoDome();
  1924.     marcDuinoFoot();
  1925.     toggleSettings();
  1926.     printOutput();
  1927.    
  1928.     // If running a custom MarcDuino Panel Routine - Call Function
  1929.     if (runningCustRoutine)
  1930.     {
  1931.        custMarcDuinoPanel();    
  1932.     }
  1933.    
  1934.     // If dome automation is enabled - Call function
  1935.     if (domeAutomation && time360DomeTurn > 1999 && time360DomeTurn < 8001 && domeAutoSpeed > 49 && domeAutoSpeed < 101)  
  1936.     {
  1937.        autoDome();
  1938.     }  
  1939. }
  1940.  
  1941. // =======================================================================================
  1942. //           footDrive Motor Control Section
  1943. // =======================================================================================
  1944.  
  1945. #if FOOT_CONTROLLER == 1
  1946. int leftFoot,rightFoot; //will hold foot speed values (-100 to 100)
  1947. int prevLeftFoot,prevRightFoot; //will hold foot speed values (-100 to 100)
  1948. void mixBHD(byte stickX, byte stickY, byte maxDriveSpeed){  //maxDriveSpeed should be between 90 and 180
  1949.     // This is BigHappyDude's mixing function, for differential (tank) style drive using two motor controllers.
  1950.     // Takes a joysticks X and Y values, mixes using the diamind mix, and output a value 0-180 for left and right motors.    
  1951.     // 180,180 = both feet full speed forward.
  1952.     // 000,000 = both feet full speed reverse.
  1953.     // 180,000 = left foot full forward, right foot full reverse (spin droid clockwise)
  1954.     // 000,180 = left foot full reverse, right foot full forward (spin droid counter-clockwise)
  1955.     // 090,090 = no movement
  1956.     // for simplicity, we think of this diamond matrix as a range from -100 to +100 , then map the final values to servo range (0-180) at the end
  1957.     //  Ramping and Speed mode applied on the droid.  
  1958.     if(((stickX <= 113) || (stickX >= 141)) || ((stickY <= 113) || (stickY >= 141))){  //  if movement outside deadzone
  1959.       //  Map to easy grid -100 to 100 in both axis, including deadzones.
  1960.       int YDist = 0;  // set to 0 as a default value if no if used.
  1961.       int XDist = 0;
  1962.       if(stickY <= 113){
  1963.        YDist = (map(stickY, 0, 113, 100, 1));           //  Map the up direction stick value to Drive speed
  1964.       } else if(stickY >= 141){
  1965.        YDist = (map(stickY, 141, 255, -1, -100));       //  Map the down direction stick value to Drive speed
  1966.       }
  1967.       if(stickX <= 113){
  1968.        XDist = (map(stickX, 0, 113, -100, -1));       //  Map the left direction stick value to Turn speed
  1969.       } else if(stickX >= 141){
  1970.        XDist = (map(stickX, 141, 255, 1, 100));   //  Map the right direction stick value to Turn speed
  1971.       }
  1972.       //  Constrain to Diamond values.  using 2 line equations and find the intersect, boiled down to the minimum
  1973.       //  This was the inspiration; https://github.com/declanshanaghy/JabberBot/raw/master/Docs/Using%20Diamond%20Coordinates%20to%20Power%20a%20Differential%20Drive.pdf
  1974.       float TempYDist = YDist;
  1975.       float TempXDist = XDist;
  1976.       if (YDist>(XDist+100)) {  //  if outside top left.  equation of line is y=x+Max, so if y > x+Max then it is above line
  1977.         // OK, the first fun bit. :)  so for the 2 lines this is always true y = m1*x + b1 and y = m2*x - b2
  1978.         // y - y = m1*x + b1  - m2*x - b2  or 0 = (m1 - m2)*x + b1 - b2
  1979.         // We have y = x+100 and y = ((change in y)/Change in x))x
  1980.         // So:   x = -100/(1-(change in y)/Change in x)) and using y = x+100 we can find y with the new x
  1981.         // Not too bad when simplified. :P
  1982.         TempXDist = -100/(1-(TempYDist/TempXDist));
  1983.         TempYDist = TempXDist+100;
  1984.       } else if (YDist>(100-XDist)) {  //  if outside top right
  1985.         // repeat intesection for y = 100 - x
  1986.         TempXDist = -100/(-1-(TempYDist/TempXDist));
  1987.         TempYDist = -TempXDist+100;
  1988.       } else if (YDist<(-XDist-100)) {  //  if outside bottom left
  1989.         // repeat intesection for y = -x - 100
  1990.         TempXDist = 100/(-1-(TempYDist/TempXDist));
  1991.         TempYDist = -TempXDist-100;
  1992.       } else if (YDist<(XDist-100)) {  //  if outside bottom right
  1993.         // repeat intesection for y = x - 100
  1994.         TempXDist = 100/(1-(TempYDist/TempXDist));
  1995.         TempYDist = TempXDist-100;
  1996.       }
  1997.       //  all coordinates now in diamond. next translate to the diamond coordinates.
  1998.       //  for the left.  send ray to y = x + Max from coordinates along y = -x + b
  1999.       //  find for b, solve for coordinates and resut in y then scale using y = (y - max/2)*2
  2000.       float LeftSpeed = ((TempXDist+TempYDist-100)/2)+100;
  2001.       LeftSpeed = (LeftSpeed-50)*2;
  2002.       //  for right send ray to y = -x + Max from coordinates along y = x + b find intersction coordinates and then use the Y vaule and scale.
  2003.       float RightSpeed = ((TempYDist-TempXDist-100)/2)+100;
  2004.       RightSpeed = (RightSpeed-50)*2;
  2005.       // this all results in a -100 to 100 range of speeds, so shift to servo range...
  2006.       //  eg. for a maxDriveSpeed of 140, we'd need the value to map to between 40 and 140
  2007.       //  eg. for a maxDriveSpeed of 180, we'd need the value to map to between 0 and 180
  2008.       //leftFoot=map(LeftSpeed, -100, 100, (180-maxDriveSpeed), maxDriveSpeed);
  2009.       //rightFoot=map(RightSpeed, -100, 100, (180-maxDriveSpeed), maxDriveSpeed);
  2010.       #if invertLeft == 0
  2011.         leftFoot=map(LeftSpeed, 100, -100, maxDriveSpeed, (180-maxDriveSpeed) );
  2012.       #else
  2013.         leftFoot=map(LeftSpeed, -100, 100, maxDriveSpeed, (180-maxDriveSpeed) );
  2014.       #endif
  2015.       #if invertLeft == 0
  2016.         rightFoot=map(RightSpeed, 100, -100, maxDriveSpeed, (180-maxDriveSpeed) );
  2017.       #else
  2018.         rightFoot=map(RightSpeed, -100, 100, maxDriveSpeed, (180-maxDriveSpeed) );
  2019.       #endif
  2020.     } else {
  2021.       leftFoot=90;
  2022.       rightFoot=90;
  2023.     }
  2024. }
  2025. #endif
  2026.  
  2027. void stopFeet() {
  2028.   #if FOOT_CONTROLLER == 0
  2029.   ST->stop();
  2030.   #elif FOOT_CONTROLLER == 1
  2031.   leftFoot=90;
  2032.   rightFoot=90;
  2033.   leftFootSignal.write(90);
  2034.   rightFootSignal.write(90);
  2035.   #endif
  2036.   #ifdef SHADOW_VERBOSE      
  2037.    output += "\r\n***Foot Motor STOPPED***\r\n";
  2038.   #endif  
  2039. }
  2040.  
  2041. boolean ps3FootMotorDrive(PS3BT* myPS = PS3NavFoot)
  2042. {
  2043.   int stickSpeed = 0;
  2044.   int turnnum = 0;
  2045.  
  2046.   if (isPS3NavigatonInitialized)
  2047.   {    
  2048.       // Additional fault control.  Do NOT send additional commands to Sabertooth if no controllers have initialized.
  2049.       if (!isStickEnabled)
  2050.       {
  2051.             #ifdef SHADOW_VERBOSE
  2052.               if ( abs(myPS->getAnalogHat(LeftHatY)-128) > joystickFootDeadZoneRange)
  2053.               {
  2054.                 output += "Drive Stick is disabled\r\n";
  2055.               }
  2056.             #endif
  2057.  
  2058.           if (!isFootMotorStopped)
  2059.           {
  2060.               stopFeet();
  2061.               isFootMotorStopped = true;
  2062.               footDriveSpeed = 0;
  2063.              
  2064.               #ifdef SHADOW_VERBOSE      
  2065.                   output += "\r\n***Foot Motor STOPPED***\r\n";
  2066.               #endif              
  2067.           }
  2068.          
  2069.           return false;
  2070.  
  2071.       } else if (!myPS->PS3NavigationConnected)
  2072.       {
  2073.        
  2074.           if (!isFootMotorStopped)
  2075.           {
  2076.               stopFeet();
  2077.               isFootMotorStopped = true;
  2078.               footDriveSpeed = 0;
  2079.  
  2080.               #ifdef SHADOW_VERBOSE      
  2081.                   output += "\r\n***Foot Motor STOPPED***\r\n";
  2082.               #endif              
  2083.           }
  2084.          
  2085.           return false;
  2086.  
  2087.          
  2088.       } else if (myPS->getButtonPress(L2) || myPS->getButtonPress(L1))
  2089.       {
  2090.        
  2091.           if (!isFootMotorStopped)
  2092.           {
  2093.               stopFeet();
  2094.               isFootMotorStopped = true;
  2095.               footDriveSpeed = 0;
  2096.  
  2097.               #ifdef SHADOW_VERBOSE      
  2098.                   output += "\r\n***Foot Motor STOPPED***\r\n";
  2099.               #endif
  2100.              
  2101.           }
  2102.          
  2103.           return false;
  2104.        
  2105.       } else
  2106.       {
  2107.           //make those feet move!!!///////////////////////////////////////////////////
  2108.           int joystickPosition = myPS->getAnalogHat(LeftHatY);
  2109.  
  2110.          #if FOOT_CONTROLLER == 0
  2111.           if (overSpeedSelected) //Over throttle is selected
  2112.           {
  2113.  
  2114.             stickSpeed = (map(joystickPosition, 0, 255, -drivespeed2, drivespeed2));  
  2115.            
  2116.           } else
  2117.           {
  2118.            
  2119.             stickSpeed = (map(joystickPosition, 0, 255, -drivespeed1, drivespeed1));
  2120.            
  2121.           }          
  2122.  
  2123.           if ( abs(joystickPosition-128) < joystickFootDeadZoneRange)
  2124.           {
  2125.  
  2126.                 // This is RAMP DOWN code when stick is now at ZERO but prior FootSpeed > 20
  2127.                
  2128.                 if (abs(footDriveSpeed) > 50)
  2129.                 {  
  2130.                     if (footDriveSpeed > 0)
  2131.                     {
  2132.                         footDriveSpeed -= 3;
  2133.                     } else
  2134.                     {
  2135.                         footDriveSpeed += 3;
  2136.                     }
  2137.                    
  2138.                     #ifdef SHADOW_VERBOSE      
  2139.                         output += "ZERO FAST RAMP: footSpeed: ";
  2140.                         output += footDriveSpeed;
  2141.                         output += "\nStick Speed: ";
  2142.                         output += stickSpeed;
  2143.                         output += "\n\r";
  2144.                     #endif
  2145.                    
  2146.                 } else if (abs(footDriveSpeed) > 20)
  2147.                 {  
  2148.                     if (footDriveSpeed > 0)
  2149.                     {
  2150.                         footDriveSpeed -= 2;
  2151.                     } else
  2152.                     {
  2153.                         footDriveSpeed += 2;
  2154.                     }
  2155.                    
  2156.                     #ifdef SHADOW_VERBOSE      
  2157.                         output += "ZERO MID RAMP: footSpeed: ";
  2158.                         output += footDriveSpeed;
  2159.                         output += "\nStick Speed: ";
  2160.                         output += stickSpeed;
  2161.                         output += "\n\r";
  2162.                     #endif
  2163.                    
  2164.                 } else
  2165.                 {        
  2166.                     footDriveSpeed = 0;
  2167.                 }
  2168.              
  2169.           } else
  2170.           {
  2171.      
  2172.               isFootMotorStopped = false;
  2173.              
  2174.               if (footDriveSpeed < stickSpeed)
  2175.               {
  2176.                
  2177.                   if ((stickSpeed-footDriveSpeed)>(ramping+1))
  2178.                   {
  2179.                     footDriveSpeed+=ramping;
  2180.                      
  2181.                     #ifdef SHADOW_VERBOSE      
  2182.                         output += "RAMPING UP: footSpeed: ";
  2183.                         output += footDriveSpeed;
  2184.                         output += "\nStick Speed: ";
  2185.                         output += stickSpeed;
  2186.                         output += "\n\r";
  2187.                     #endif
  2188.                      
  2189.                   } else
  2190.                       footDriveSpeed = stickSpeed;
  2191.                  
  2192.               } else if (footDriveSpeed > stickSpeed)
  2193.               {
  2194.            
  2195.                   if ((footDriveSpeed-stickSpeed)>(ramping+1))
  2196.                   {
  2197.                    
  2198.                     footDriveSpeed-=ramping;
  2199.                      
  2200.                     #ifdef SHADOW_VERBOSE      
  2201.                         output += "RAMPING DOWN: footSpeed: ";
  2202.                         output += footDriveSpeed;
  2203.                         output += "\nStick Speed: ";
  2204.                         output += stickSpeed;
  2205.                         output += "\n\r";
  2206.                     #endif
  2207.                    
  2208.                   } else
  2209.                       footDriveSpeed = stickSpeed;  
  2210.               } else
  2211.               {
  2212.                   footDriveSpeed = stickSpeed;  
  2213.               }
  2214.           }
  2215.          
  2216.           turnnum = (myPS->getAnalogHat(LeftHatX));
  2217.  
  2218.           //TODO:  Is there a better algorithm here?  
  2219.           if ( abs(footDriveSpeed) > 50)
  2220.               turnnum = (map(myPS->getAnalogHat(LeftHatX), 54, 200, -(turnspeed/4), (turnspeed/4)));
  2221.           else if (turnnum <= 200 && turnnum >= 54)
  2222.               turnnum = (map(myPS->getAnalogHat(LeftHatX), 54, 200, -(turnspeed/3), (turnspeed/3)));
  2223.           else if (turnnum > 200)
  2224.               turnnum = (map(myPS->getAnalogHat(LeftHatX), 201, 255, turnspeed/3, turnspeed));
  2225.           else if (turnnum < 54)
  2226.               turnnum = (map(myPS->getAnalogHat(LeftHatX), 0, 53, -turnspeed, -(turnspeed/3)));
  2227.              
  2228.           if (abs(turnnum) > 5)
  2229.           {
  2230.               isFootMotorStopped = false;  
  2231.           }
  2232.          #endif
  2233.  
  2234.           currentMillis = millis();
  2235.          
  2236.           if ( (currentMillis - previousFootMillis) > serialLatency  )
  2237.           {
  2238.  
  2239.               #if FOOT_CONTROLLER == 0
  2240.               if (footDriveSpeed != 0 || abs(turnnum) > 5)
  2241.               #elif FOOT_CONTROLLER == 1
  2242.               //if (footDriveSpeed != 0) //footDriveSpeed doesn't change with the Q85's
  2243.               if (true)
  2244.               #endif
  2245.               {
  2246.                
  2247.                   #ifdef SHADOW_VERBOSE  
  2248.                     #if FOOT_CONTROLLER == 0  
  2249.                     output += "Motor: FootSpeed: ";
  2250.                     output += footDriveSpeed;
  2251.                     output += "\nTurnnum: ";              
  2252.                     output += turnnum;
  2253.                     output += "\nTime of command: ";              
  2254.                     output += millis();
  2255.                     #endif
  2256.                   #endif
  2257.  
  2258.                   #if FOOT_CONTROLLER == 0
  2259.                     ST->turn(turnnum * invertTurnDirection);
  2260.                     ST->drive(footDriveSpeed);
  2261.                   #elif FOOT_CONTROLLER == 1
  2262.                     isFootMotorStopped = false;
  2263.                     footX=myPS->getAnalogHat(LeftHatX);
  2264.                     footY=myPS->getAnalogHat(LeftHatY);
  2265.                     //Experimental Q85. Untested Madness!!! Use at your own risk and expect your droid to run away in flames.
  2266.                     //use BigHappyDude's mixing algorythm to get values for each foot...
  2267.                     if (overSpeedSelected) {
  2268.                       mixBHD(footX,footY,drivespeed2);
  2269.                     }
  2270.                     else {
  2271.                       mixBHD(footX,footY,drivespeed1);                
  2272.                     }
  2273.                     #ifdef SHADOW_VERBOSE  
  2274.                       if (prevLeftFoot!=leftFoot || prevRightFoot!=rightFoot) {
  2275.                         output += "  footX="+String(footX)+", footY="+String(footY);
  2276.                         if (overSpeedSelected) output += "\ndrivespeed2";
  2277.                         else output += "\ndrivespeed1";
  2278.                         output += "  L: ";
  2279.                         output += leftFoot;
  2280.                         output += "  R: ";              
  2281.                         output += rightFoot;
  2282.  
  2283.                       }
  2284.                     #endif                    
  2285.                     //now we've got values for leftFoot and rightFoot, output those somehow...
  2286.                     if (prevLeftFoot!=leftFoot || prevRightFoot!=rightFoot) {
  2287.                       leftFootSignal.write(leftFoot);
  2288.                       rightFootSignal.write(rightFoot);
  2289.                     }
  2290.                     prevLeftFoot=leftFoot;
  2291.                     prevRightFoot=rightFoot;
  2292.                   #endif
  2293.               } else
  2294.               {    
  2295.                   if (!isFootMotorStopped)
  2296.                   {
  2297.                       stopFeet();
  2298.                       isFootMotorStopped = true;
  2299.                       footDriveSpeed = 0;
  2300.                      
  2301.                       #ifdef SHADOW_VERBOSE      
  2302.                          output += "\r\n***Foot Motor STOPPED***\r\n";
  2303.                       #endif
  2304.                   }              
  2305.               }
  2306.              
  2307.               // The Sabertooth won't act on mixed mode packet serial commands until
  2308.               // it has received power levels for BOTH throttle and turning, since it
  2309.               // mixes the two together to get diff-drive power levels for both motors.
  2310.              
  2311.               previousFootMillis = currentMillis;
  2312.               return true; //we sent a foot command  
  2313.           }
  2314.       }
  2315.       //prevThrottle=myPS->getAnalogHat(LeftHatY); //used for blinkies
  2316.   }
  2317.   return false;
  2318. }
  2319.  
  2320. void footMotorDrive()
  2321. {
  2322.  
  2323.   //Flood control prevention
  2324.   if ((millis() - previousFootMillis) < serialLatency) return;  
  2325.  
  2326.   if (PS3NavFoot->PS3NavigationConnected) ps3FootMotorDrive(PS3NavFoot);
  2327.  
  2328. }  
  2329.  
  2330.  
  2331. // =======================================================================================
  2332. //           domeDrive Motor Control Section
  2333. // =======================================================================================
  2334.  
  2335. int ps3DomeDrive(PS3BT* myPS = PS3NavDome)
  2336. {
  2337.     int domeRotationSpeed = 0;
  2338.      
  2339.     int joystickPosition = myPS->getAnalogHat(LeftHatX);
  2340.        
  2341.     domeRotationSpeed = (map(joystickPosition, 0, 255, -domespeed, domespeed));
  2342.        
  2343.     if ( abs(joystickPosition-128) < joystickDomeDeadZoneRange )
  2344.        domeRotationSpeed = 0;
  2345.          
  2346.     if (domeRotationSpeed != 0 && domeAutomation == true)  // Turn off dome automation if manually moved
  2347.     {  
  2348.             domeAutomation = false;
  2349.             domeStatus = 0;
  2350.             domeTargetPosition = 0;
  2351.            
  2352.             #ifdef SHADOW_VERBOSE
  2353.               output += "Dome Automation OFF\r\n";
  2354.             #endif
  2355.  
  2356.     }    
  2357.    
  2358.     return domeRotationSpeed;
  2359. }
  2360.  
  2361. void rotateDome(int domeRotationSpeed, String mesg)
  2362. {
  2363.     //Constantly sending commands to the SyRen (Dome) is causing foot motor delay.
  2364.     //Lets reduce that chatter by trying 3 things:
  2365.     // 1.) Eliminate a constant stream of "don't spin" messages (isDomeMotorStopped flag)
  2366.     // 2.) Add a delay between commands sent to the SyRen (previousDomeMillis timer)
  2367.     // 3.) Switch to real UART on the MEGA (Likely the *CORE* issue and solution)
  2368.     // 4.) Reduce the timout of the SyRen - just better for safety!
  2369.    
  2370.     currentMillis = millis();
  2371.     if ( (!isDomeMotorStopped || domeRotationSpeed != 0) && ((currentMillis - previousDomeMillis) > (2*serialLatency) )  )
  2372.     {
  2373.      
  2374.           if (domeRotationSpeed != 0)
  2375.           {
  2376.            
  2377.             isDomeMotorStopped = false;
  2378.            
  2379.             #ifdef SHADOW_VERBOSE      
  2380.                 output += "Dome rotation speed: ";
  2381.                 output += domeRotationSpeed;
  2382.             #endif
  2383.        
  2384.             SyR->motor(domeRotationSpeed);
  2385.            
  2386.           } else
  2387.           {
  2388.             isDomeMotorStopped = true;
  2389.            
  2390.             #ifdef SHADOW_VERBOSE      
  2391.                 output += "\n\r***Dome motor is STOPPED***\n\r";
  2392.             #endif
  2393.            
  2394.             SyR->stop();
  2395.           }
  2396.          
  2397.           previousDomeMillis = currentMillis;      
  2398.     }
  2399. }
  2400.  
  2401. void domeDrive()
  2402. {
  2403.   //Flood control prevention
  2404.   //This is intentionally set to double the rate of the Dome Motor Latency
  2405.   if ((millis() - previousDomeMillis) < (2*serialLatency) ) return;  
  2406.  
  2407.   int domeRotationSpeed = 0;
  2408.   int ps3NavControlSpeed = 0;
  2409.  
  2410.   if (PS3NavDome->PS3NavigationConnected)
  2411.   {
  2412.    
  2413.      ps3NavControlSpeed = ps3DomeDrive(PS3NavDome);
  2414.  
  2415.      domeRotationSpeed = ps3NavControlSpeed;
  2416.  
  2417.      rotateDome(domeRotationSpeed,"Controller Move");
  2418.    
  2419.   } else if (PS3NavFoot->PS3NavigationConnected && PS3NavFoot->getButtonPress(L2))
  2420.   {
  2421.    
  2422.      ps3NavControlSpeed = ps3DomeDrive(PS3NavFoot);
  2423.  
  2424.      domeRotationSpeed = ps3NavControlSpeed;
  2425.  
  2426.      rotateDome(domeRotationSpeed,"Controller Move");
  2427.    
  2428.   } else
  2429.   {
  2430.      if (!isDomeMotorStopped)
  2431.      {
  2432.          SyR->stop();
  2433.          isDomeMotorStopped = true;
  2434.      }
  2435.   }  
  2436. }  
  2437.  
  2438. // =======================================================================================
  2439. //                               Toggle Control Section
  2440. // =======================================================================================
  2441.  
  2442. void ps3ToggleSettings(PS3BT* myPS = PS3NavFoot)
  2443. {
  2444.  
  2445.     // enable / disable drive stick
  2446.     if(myPS->getButtonPress(PS) && myPS->getButtonClick(CROSS))
  2447.     {
  2448.  
  2449.         #ifdef SHADOW_DEBUG
  2450.           output += "Disabling the DriveStick\r\n";
  2451.           output += "Stopping Motors";
  2452.         #endif
  2453.        
  2454.         stopFeet();
  2455.         isFootMotorStopped = true;
  2456.         isStickEnabled = false;
  2457.         footDriveSpeed = 0;
  2458.     }
  2459.    
  2460.     if(myPS->getButtonPress(PS) && myPS->getButtonClick(CIRCLE))
  2461.     {
  2462.         #ifdef SHADOW_DEBUG
  2463.           output += "Enabling the DriveStick\r\n";
  2464.         #endif
  2465.         isStickEnabled = true;
  2466.     }
  2467.    
  2468.     // Enable and Disable Overspeed
  2469.     if (myPS->getButtonPress(L3) && myPS->getButtonPress(L1) && isStickEnabled)
  2470.     {
  2471.      
  2472.        if ((millis() - previousSpeedToggleMillis) > 1000)
  2473.        {
  2474.             speedToggleButtonCounter = 0;
  2475.             previousSpeedToggleMillis = millis();
  2476.        }
  2477.      
  2478.        speedToggleButtonCounter += 1;
  2479.        
  2480.        if (speedToggleButtonCounter == 1)
  2481.        {
  2482.        
  2483.           if (!overSpeedSelected)
  2484.           {
  2485.            
  2486.                 overSpeedSelected = true;
  2487.            
  2488.                 #ifdef SHADOW_VERBOSE      
  2489.                   output += "Over Speed is now: ON";
  2490.                 #endif
  2491.                
  2492.           } else
  2493.           {      
  2494.                 overSpeedSelected = false;
  2495.            
  2496.                 #ifdef SHADOW_VERBOSE      
  2497.                   output += "Over Speed is now: OFF";
  2498.                 #endif  
  2499.           }  
  2500.        }
  2501.     }
  2502.    
  2503.     // Enable Disable Dome Automation
  2504.     if(myPS->getButtonPress(L2) && myPS->getButtonClick(CROSS))
  2505.     {
  2506.           domeAutomation = false;
  2507.           domeStatus = 0;
  2508.           domeTargetPosition = 0;
  2509.           SyR->stop();
  2510.           isDomeMotorStopped = true;
  2511.          
  2512.           #ifdef SHADOW_DEBUG
  2513.             output += "Dome Automation OFF\r\n";
  2514.           #endif
  2515.     }
  2516.  
  2517.     if(myPS->getButtonPress(L2) && myPS->getButtonClick(CIRCLE))
  2518.     {
  2519.           domeAutomation = true;
  2520.  
  2521.           #ifdef SHADOW_DEBUG
  2522.             output += "Dome Automation On\r\n";
  2523.           #endif
  2524.     }
  2525.  
  2526. }
  2527.  
  2528. void toggleSettings()
  2529. {
  2530.    if (PS3NavFoot->PS3NavigationConnected) ps3ToggleSettings(PS3NavFoot);
  2531. }  
  2532.  
  2533. // =======================================================================================
  2534. // This is the main MarcDuino Button Management Function
  2535. // =======================================================================================
  2536. void marcDuinoButtonPush(int type, int MD_func, int MP3_num, int LD_type, String LD_text, int panel_type,
  2537.                          boolean use_DP1,
  2538.                          int DP1_str_delay,
  2539.                          int DP1_open_time,
  2540.                          boolean use_DP2,
  2541.                          int DP2_str_delay,
  2542.                          int DP2_open_time,
  2543.                          boolean use_DP3,
  2544.                          int DP3_str_delay,
  2545.                          int DP3_open_time,
  2546.                          boolean use_DP4,
  2547.                          int DP4_str_delay,
  2548.                          int DP4_open_time,
  2549.                          boolean use_DP5,
  2550.                          int DP5_str_delay,
  2551.                          int DP5_open_time,
  2552.                          boolean use_DP6,
  2553.                          int DP6_str_delay,
  2554.                          int DP6_open_time,
  2555.                          boolean use_DP7,
  2556.                          int DP7_str_delay,
  2557.                          int DP7_open_time,
  2558.                          boolean use_DP8,
  2559.                          int DP8_str_delay,
  2560.                          int DP8_open_time,
  2561.                          boolean use_DP9,
  2562.                          int DP9_str_delay,
  2563.                          int DP9_open_time,
  2564.                          boolean use_DP10,
  2565.                          int DP10_str_delay,
  2566.                          int DP10_open_time)
  2567. {
  2568.  
  2569.   if (type == 1)  // Std Marcduino Function Call Configured
  2570.   {
  2571.    
  2572.     switch (MD_func)
  2573.     {
  2574.       case 1:  
  2575.         Serial1.print(":SE00\r");  
  2576.         break;
  2577.  
  2578.       case 2:
  2579.         Serial1.print(":SE01\r");
  2580.         break;
  2581.        
  2582.       case 3:
  2583.         Serial1.print(":SE02\r");
  2584.         break;
  2585.        
  2586.       case 4:
  2587.         Serial1.print(":SE03\r");
  2588.         break;
  2589.                
  2590.       case 5:
  2591.         Serial1.print(":SE04\r");
  2592.         break;
  2593.                
  2594.       case 6:
  2595.         Serial1.print(":SE05\r");
  2596.         break;
  2597.                
  2598.       case 7:
  2599.         Serial1.print(":SE06\r");
  2600.         break;
  2601.                
  2602.       case 8:
  2603.         Serial1.print(":SE07\r");
  2604.         break;
  2605.                
  2606.       case 9:
  2607.         Serial1.print(":SE08\r");
  2608.         break;
  2609.                
  2610.       case 10:
  2611.         Serial1.print(":SE09\r");
  2612.         break;
  2613.                
  2614.       case 11:
  2615.         Serial1.print(":SE10\r");
  2616.         break;
  2617.                
  2618.       case 12:
  2619.         Serial1.print(":SE11\r");
  2620.         break;
  2621.                
  2622.       case 13:
  2623.         Serial1.print(":SE13\r");
  2624.         break;
  2625.                
  2626.       case 14:
  2627.         Serial1.print(":SE14\r");
  2628.         break;
  2629.                
  2630.       case 15:
  2631.         Serial1.print(":SE51\r");
  2632.         break;
  2633.                
  2634.       case 16:
  2635.         Serial1.print(":SE52\r");
  2636.         break;
  2637.                
  2638.       case 17:
  2639.         Serial1.print(":SE53\r");
  2640.         break;
  2641.                
  2642.       case 18:
  2643.         Serial1.print(":SE54\r");
  2644.         break;
  2645.                
  2646.       case 19:
  2647.         Serial1.print(":SE55\r");
  2648.         break;
  2649.                
  2650.       case 20:
  2651.         Serial1.print(":SE56\r");
  2652.         break;
  2653.                
  2654.       case 21:
  2655.         Serial1.print(":SE57\r");
  2656.         break;
  2657.                
  2658.       case 22:
  2659.         Serial1.print("*RD00\r");
  2660.         break;
  2661.                
  2662.       case 23:
  2663.         Serial1.print("*ON00\r");
  2664.         break;
  2665.                
  2666.       case 24:
  2667.         Serial1.print("*OF00\r");
  2668.         break;
  2669.                
  2670.       case 25:
  2671.         Serial1.print("*ST00\r");
  2672.         break;
  2673.                
  2674.       case 26:
  2675.         Serial1.print("$+\r");
  2676.         break;
  2677.                
  2678.       case 27:
  2679.         Serial1.print("$-\r");
  2680.         break;
  2681.                
  2682.       case 28:
  2683.         Serial1.print("$f\r");
  2684.         break;
  2685.                
  2686.       case 29:
  2687.         Serial1.print("$m\r");
  2688.         break;
  2689.                
  2690.       case 30:
  2691.         Serial1.print(":OP00\r");
  2692.         break;
  2693.                
  2694.       case 31:
  2695.         Serial1.print(":OP11\r");
  2696.         break;
  2697.                
  2698.       case 32:
  2699.         Serial1.print(":OP12\r");
  2700.         break;
  2701.                
  2702.       case 33:
  2703.         Serial1.print(":CL00\r");
  2704.         break;
  2705.                
  2706.       case 34:
  2707.         Serial1.print(":OP01\r");
  2708.         break;
  2709.                
  2710.       case 35:
  2711.         Serial1.print(":CL01\r");
  2712.         break;
  2713.                
  2714.       case 36:
  2715.         Serial1.print(":OP02\r");
  2716.         break;
  2717.                
  2718.       case 37:
  2719.         Serial1.print(":CL02\r");
  2720.         break;
  2721.                
  2722.       case 38:
  2723.         Serial1.print(":OP03\r");
  2724.         break;
  2725.                
  2726.       case 39:
  2727.         Serial1.print(":CL03\r");
  2728.         break;
  2729.                
  2730.       case 40:
  2731.         Serial1.print(":OP04\r");
  2732.         break;
  2733.                
  2734.       case 41:
  2735.         Serial1.print(":CL04\r");
  2736.         break;
  2737.                
  2738.       case 42:
  2739.         Serial1.print(":OP05\r");
  2740.         break;
  2741.                
  2742.       case 43:
  2743.         Serial1.print(":CL05\r");
  2744.         break;
  2745.                
  2746.       case 44:
  2747.         Serial1.print(":OP06\r");
  2748.         break;
  2749.                
  2750.       case 45:
  2751.         Serial1.print(":CL06\r");
  2752.         break;
  2753.                
  2754.       case 46:
  2755.         Serial1.print(":OP07\r");
  2756.         break;
  2757.                
  2758.       case 47:
  2759.         Serial1.print(":CL07\r");
  2760.         break;
  2761.                
  2762.       case 48:
  2763.         Serial1.print(":OP08\r");
  2764.         break;
  2765.                
  2766.       case 49:
  2767.         Serial1.print(":CL08\r");
  2768.         break;
  2769.                
  2770.       case 50:
  2771.         Serial1.print(":OP09\r");
  2772.         break;
  2773.                
  2774.       case 51:
  2775.         Serial1.print(":CL09\r");
  2776.         break;
  2777.                
  2778.       case 52:
  2779.         Serial1.print(":OP10\r");
  2780.         break;
  2781.                
  2782.       case 53:
  2783.         Serial1.print(":CL10\r");
  2784.         break;
  2785.                
  2786.       case 54:
  2787.         Serial3.print(":OP00\r");
  2788.         break;
  2789.                
  2790.       case 55:
  2791.         Serial3.print(":CL00\r");
  2792.         break;
  2793.                
  2794.       case 56:
  2795.         Serial3.print(":OP01\r");
  2796.         break;
  2797.                
  2798.       case 57:
  2799.         Serial3.print(":CL01\r");
  2800.         break;
  2801.                
  2802.       case 58:
  2803.         Serial3.print(":OP02\r");
  2804.         break;
  2805.                
  2806.       case 59:
  2807.         Serial3.print(":CL02\r");
  2808.         break;
  2809.                
  2810.       case 60:
  2811.         Serial3.print(":OP03\r");
  2812.         break;
  2813.                
  2814.       case 61:
  2815.         Serial3.print(":CL03\r");
  2816.         break;
  2817.                
  2818.       case 62:
  2819.         Serial3.print(":OP04\r");
  2820.         break;
  2821.                
  2822.       case 63:
  2823.         Serial3.print(":CL04\r");
  2824.         break;
  2825.                
  2826.       case 64:
  2827.         Serial3.print(":OP05\r");
  2828.         break;
  2829.                
  2830.       case 65:
  2831.         Serial3.print(":CL05\r");
  2832.         break;
  2833.                
  2834.       case 66:
  2835.         Serial3.print(":OP06\r");
  2836.         break;
  2837.                
  2838.       case 67:
  2839.         Serial3.print(":CL06\r");
  2840.         break;
  2841.                
  2842.       case 68:
  2843.         Serial3.print(":OP07\r");
  2844.         break;
  2845.                
  2846.       case 69:
  2847.         Serial3.print(":CL07\r");
  2848.         break;
  2849.                
  2850.       case 70:
  2851.         Serial3.print(":OP08\r");
  2852.         break;
  2853.                
  2854.       case 71:
  2855.         Serial3.print(":CL08\r");
  2856.         break;
  2857.                
  2858.       case 72:
  2859.         Serial3.print(":OP09\r");
  2860.         break;
  2861.                
  2862.       case 73:
  2863.         Serial3.print(":CL09\r");
  2864.         break;
  2865.                
  2866.       case 74:
  2867.         Serial3.print(":OP10\r");
  2868.         break;
  2869.  
  2870.       case 75:
  2871.         Serial3.print(":CL10\r");
  2872.         break;
  2873.  
  2874.       case 76:
  2875.         Serial3.print("*MO99\r");
  2876.         break;
  2877.  
  2878.       case 77:
  2879.         Serial3.print("*MO00\r");
  2880.         break;
  2881.  
  2882.       case 78:
  2883.         Serial3.print("*MF10\r");
  2884.         break;
  2885.  
  2886.     }  
  2887.    
  2888.   }  // End Std Marcduino Function Calls
  2889.    
  2890.    
  2891.   if (type == 2) // Custom Button Configuration
  2892.   {
  2893.    
  2894.       if (MP3_num > 181 && MP3_num < 201) // Valid Custom Sound Range Selected - Play Custom Sound Selection
  2895.       {
  2896.        
  2897.         switch (MP3_num)
  2898.         {
  2899.          
  2900.           case 182:
  2901.              Serial1.print("$87\r");
  2902.              break;
  2903.              
  2904.           case 183:
  2905.              Serial1.print("$88\r");
  2906.              break;
  2907.          
  2908.           case 184:
  2909.              Serial1.print("$89\r");
  2910.              break;
  2911.  
  2912.           case 185:
  2913.              Serial1.print("$810\r");
  2914.              break;
  2915.              
  2916.           case 186:
  2917.              Serial1.print("$811\r");
  2918.              break;
  2919.          
  2920.           case 187:
  2921.              Serial1.print("$812\r");
  2922.              break;
  2923.           case 188:
  2924.              Serial1.print("$813\r");
  2925.              break;
  2926.              
  2927.           case 189:
  2928.              Serial1.print("$814\r");
  2929.              break;
  2930.          
  2931.           case 190:
  2932.              Serial1.print("$815\r");
  2933.              break;
  2934.              
  2935.           case 191:
  2936.              Serial1.print("$816\r");
  2937.              break;
  2938.              
  2939.           case 192:
  2940.              Serial1.print("$817\r");
  2941.              break;
  2942.          
  2943.           case 193:
  2944.              Serial1.print("$818\r");
  2945.              break;
  2946.              
  2947.           case 194:
  2948.              Serial1.print("$819\r");
  2949.              break;
  2950.              
  2951.           case 195:
  2952.              Serial1.print("$820\r");
  2953.              break;
  2954.          
  2955.           case 196:
  2956.              Serial1.print("$821\r");
  2957.              break;
  2958.              
  2959.           case 197:
  2960.              Serial1.print("$822\r");
  2961.              break;
  2962.              
  2963.           case 198:
  2964.              Serial1.print("$823\r");
  2965.              break;
  2966.          
  2967.           case 199:
  2968.              Serial1.print("$824\r");
  2969.              break;
  2970.  
  2971.           case 200:
  2972.              Serial1.print("$825\r");
  2973.              break;
  2974.          
  2975.         }    
  2976.        
  2977.       }
  2978.      
  2979.       if (panel_type > 0 && panel_type < 10) // Valid panel type selected - perform custom panel functions
  2980.       {
  2981.        
  2982.           // Reset the custom panel flags
  2983.           DP1_Status = 0;
  2984.           DP2_Status = 0;
  2985.           DP3_Status = 0;
  2986.           DP4_Status = 0;
  2987.           DP5_Status = 0;
  2988.           DP6_Status = 0;
  2989.           DP7_Status = 0;
  2990.           DP8_Status = 0;
  2991.           DP9_Status = 0;
  2992.           DP10_Status = 0;
  2993.        
  2994.           if (panel_type > 1)
  2995.           {
  2996.             Serial1.print(":CL00\r");  // close all the panels prior to next custom routine
  2997.             delay(50); // give panel close command time to process before starting next panel command
  2998.           }
  2999.        
  3000.           switch (panel_type)
  3001.           {
  3002.            
  3003.              case 1:
  3004.                 Serial1.print(":CL00\r");
  3005.                 break;
  3006.                
  3007.              case 2:
  3008.                 Serial1.print(":SE51\r");
  3009.                 break;
  3010.                
  3011.              case 3:
  3012.                 Serial1.print(":SE52\r");
  3013.                 break;
  3014.  
  3015.              case 4:
  3016.                 Serial1.print(":SE53\r");
  3017.                 break;
  3018.  
  3019.              case 5:
  3020.                 Serial1.print(":SE54\r");
  3021.                 break;
  3022.  
  3023.              case 6:
  3024.                 Serial1.print(":SE55\r");
  3025.                 break;
  3026.  
  3027.              case 7:
  3028.                 Serial1.print(":SE56\r");
  3029.                 break;
  3030.  
  3031.              case 8:
  3032.                 Serial1.print(":SE57\r");
  3033.                 break;
  3034.  
  3035.              case 9: // This is the setup section for the custom panel routines
  3036.              
  3037.                 runningCustRoutine = true;
  3038.                
  3039.                 // Configure Dome Panel #1
  3040.                 if (use_DP1)
  3041.                 {
  3042.                  
  3043.                   DP1_Status = 1;
  3044.                   DP1_start = millis();
  3045.                  
  3046.                   if (DP1_str_delay < 31)
  3047.                   {
  3048.                    
  3049.                        DP1_s_delay = DP1_str_delay;
  3050.                        
  3051.                   } else
  3052.                   {
  3053.                        DP1_Status = 0;
  3054.                   }
  3055.                  
  3056.                   if (DP1_open_time > 0 && DP1_open_time < 31)
  3057.                   {
  3058.                    
  3059.                        DP1_o_time = DP1_open_time;
  3060.                        
  3061.                   } else
  3062.                   {
  3063.                        DP1_Status = 0;
  3064.                   }
  3065.                      
  3066.                 }
  3067.                
  3068.                 // Configure Dome Panel #2
  3069.                 if (use_DP2)
  3070.                 {
  3071.                  
  3072.                   DP2_Status = 1;
  3073.                   DP2_start = millis();
  3074.                  
  3075.                   if (DP2_str_delay < 31)
  3076.                   {
  3077.                    
  3078.                        DP2_s_delay = DP2_str_delay;
  3079.                        
  3080.                   } else
  3081.                   {
  3082.                        DP2_Status = 0;
  3083.                   }
  3084.                  
  3085.                   if (DP2_open_time > 0 && DP2_open_time < 31)
  3086.                   {
  3087.                    
  3088.                        DP2_o_time = DP2_open_time;
  3089.                        
  3090.                   } else
  3091.                   {
  3092.                        DP2_Status = 0;
  3093.                   }
  3094.        
  3095.                 }
  3096.                
  3097.  
  3098.                 // Configure Dome Panel #3
  3099.                 if (use_DP3)
  3100.                 {
  3101.                  
  3102.                   DP3_Status = 1;
  3103.                   DP3_start = millis();
  3104.                  
  3105.                   if (DP3_str_delay < 31)
  3106.                   {
  3107.                    
  3108.                        DP3_s_delay = DP3_str_delay;
  3109.                        
  3110.                   } else
  3111.                   {
  3112.                        DP3_Status = 0;
  3113.                   }
  3114.                  
  3115.                   if (DP3_open_time > 0 && DP3_open_time < 31)
  3116.                   {
  3117.                    
  3118.                        DP3_o_time = DP3_open_time;
  3119.                        
  3120.                   } else
  3121.                   {
  3122.                        DP3_Status = 0;
  3123.                   }
  3124.        
  3125.                 }
  3126.                
  3127.                 // Configure Dome Panel #4
  3128.                 if (use_DP4)
  3129.                 {
  3130.                  
  3131.                   DP4_Status = 1;
  3132.                   DP4_start = millis();
  3133.                  
  3134.                   if (DP4_str_delay < 31)
  3135.                   {
  3136.                    
  3137.                        DP4_s_delay = DP4_str_delay;
  3138.                        
  3139.                   } else
  3140.                   {
  3141.                        DP4_Status = 0;
  3142.                   }
  3143.                  
  3144.                   if (DP4_open_time > 0 && DP4_open_time < 31)
  3145.                   {
  3146.                    
  3147.                        DP4_o_time = DP4_open_time;
  3148.                        
  3149.                   } else
  3150.                   {
  3151.                        DP4_Status = 0;
  3152.                   }
  3153.        
  3154.                 }
  3155.                
  3156.                 // Configure Dome Panel #5
  3157.                 if (use_DP5)
  3158.                 {
  3159.                  
  3160.                   DP5_Status = 1;
  3161.                   DP5_start = millis();
  3162.                  
  3163.                   if (DP5_str_delay < 31)
  3164.                   {
  3165.                    
  3166.                        DP5_s_delay = DP5_str_delay;
  3167.                        
  3168.                   } else
  3169.                   {
  3170.                        DP5_Status = 0;
  3171.                   }
  3172.                  
  3173.                   if (DP5_open_time > 0 && DP5_open_time < 31)
  3174.                   {
  3175.                    
  3176.                        DP5_o_time = DP5_open_time;
  3177.                        
  3178.                   } else
  3179.                   {
  3180.                        DP5_Status = 0;
  3181.                   }
  3182.        
  3183.                 }
  3184.                
  3185.                 // Configure Dome Panel #6
  3186.                 if (use_DP6)
  3187.                 {
  3188.                  
  3189.                   DP6_Status = 1;
  3190.                   DP6_start = millis();
  3191.                  
  3192.                   if (DP6_str_delay < 31)
  3193.                   {
  3194.                    
  3195.                        DP6_s_delay = DP6_str_delay;
  3196.                        
  3197.                   } else
  3198.                   {
  3199.                        DP6_Status = 0;
  3200.                   }
  3201.                  
  3202.                   if (DP6_open_time > 0 && DP6_open_time < 31)
  3203.                   {
  3204.                    
  3205.                        DP6_o_time = DP6_open_time;
  3206.                        
  3207.                   } else
  3208.                   {
  3209.                        DP6_Status = 0;
  3210.                   }
  3211.        
  3212.                 }
  3213.                
  3214.                 // Configure Dome Panel #7
  3215.                 if (use_DP7)
  3216.                 {
  3217.                  
  3218.                   DP7_Status = 1;
  3219.                   DP7_start = millis();
  3220.                  
  3221.                   if (DP7_str_delay < 31)
  3222.                   {
  3223.                    
  3224.                        DP7_s_delay = DP7_str_delay;
  3225.                        
  3226.                   } else
  3227.                   {
  3228.                        DP7_Status = 0;
  3229.                   }
  3230.                  
  3231.                   if (DP7_open_time > 0 && DP7_open_time < 31)
  3232.                   {
  3233.                    
  3234.                        DP7_o_time = DP7_open_time;
  3235.                        
  3236.                   } else
  3237.                   {
  3238.                        DP7_Status = 0;
  3239.                   }
  3240.        
  3241.                 }
  3242.                
  3243.                 // Configure Dome Panel #8
  3244.                 if (use_DP8)
  3245.                 {
  3246.                  
  3247.                   DP8_Status = 1;
  3248.                   DP8_start = millis();
  3249.                  
  3250.                   if (DP8_str_delay < 31)
  3251.                   {
  3252.                    
  3253.                        DP8_s_delay = DP8_str_delay;
  3254.                        
  3255.                   } else
  3256.                   {
  3257.                        DP8_Status = 0;
  3258.                   }
  3259.                  
  3260.                   if (DP8_open_time > 0 && DP8_open_time < 31)
  3261.                   {
  3262.                    
  3263.                        DP8_o_time = DP8_open_time;
  3264.                        
  3265.                   } else
  3266.                   {
  3267.                        DP8_Status = 0;
  3268.                   }
  3269.        
  3270.                 }
  3271.                
  3272.                 // Configure Dome Panel #9
  3273.                 if (use_DP9)
  3274.                 {
  3275.                  
  3276.                   DP9_Status = 1;
  3277.                   DP9_start = millis();
  3278.                  
  3279.                   if (DP9_str_delay < 31)
  3280.                   {
  3281.                    
  3282.                        DP9_s_delay = DP9_str_delay;
  3283.                        
  3284.                   } else
  3285.                   {
  3286.                        DP9_Status = 0;
  3287.                   }
  3288.                  
  3289.                   if (DP9_open_time > 0 && DP9_open_time < 31)
  3290.                   {
  3291.                    
  3292.                        DP9_o_time = DP9_open_time;
  3293.                        
  3294.                   } else
  3295.                   {
  3296.                        DP9_Status = 0;
  3297.                   }
  3298.        
  3299.                 }
  3300.                
  3301.                 // Configure Dome Panel #10
  3302.                 if (use_DP10)
  3303.                 {
  3304.                  
  3305.                   DP10_Status = 1;
  3306.                   DP10_start = millis();
  3307.                  
  3308.                   if (DP10_str_delay < 31)
  3309.                   {
  3310.                    
  3311.                        DP10_s_delay = DP10_str_delay;
  3312.                        
  3313.                   } else
  3314.                   {
  3315.                        DP10_Status = 0;
  3316.                   }
  3317.                  
  3318.                   if (DP10_open_time > 0 && DP10_open_time < 31)
  3319.                   {
  3320.                    
  3321.                        DP10_o_time = DP10_open_time;
  3322.                        
  3323.                   } else
  3324.                   {
  3325.                        DP10_Status = 0;
  3326.                   }
  3327.        
  3328.                 }
  3329.                              
  3330.                 // If every dome panel config failed to work - reset routine flag to false
  3331.                 if (DP1_Status + DP2_Status + DP3_Status + DP4_Status + DP5_Status + DP6_Status + DP7_Status + DP8_Status + DP9_Status + DP10_Status == 0)
  3332.                 {
  3333.                    
  3334.                    runningCustRoutine = false;
  3335.  
  3336.                 }
  3337.                
  3338.                 break;          
  3339.           }
  3340.       }
  3341.        
  3342.      
  3343.       if (LD_type > 0 && LD_type < 9) // Valid Logic Display Selected - Display Custom Logic Display
  3344.       {
  3345.        
  3346.           if (panel_type > 1 && panel_type < 10)  // If a custom panel movement was selected - need to briefly pause before changing light sequence to avoid conflict)
  3347.           {  
  3348.               delay(30);
  3349.           }
  3350.        
  3351.           switch (LD_type)
  3352.           {
  3353.            
  3354.             case 1:
  3355.               Serial1.print("@0T1\r");
  3356.               break;
  3357.              
  3358.             case 2:
  3359.               Serial1.print("@0T4\r");
  3360.               break;
  3361.              
  3362.             case 3:
  3363.               Serial1.print("@0T5\r");
  3364.               break;
  3365.  
  3366.             case 4:
  3367.               Serial1.print("@0T6\r");
  3368.               break;
  3369.  
  3370.             case 5:
  3371.               Serial1.print("@0T10\r");
  3372.               break;
  3373.  
  3374.             case 6:
  3375.               Serial1.print("@0T11\r");
  3376.               break;
  3377.  
  3378.             case 7:
  3379.               Serial1.print("@0T92\r");
  3380.               break;
  3381.  
  3382.             case 8:
  3383.               Serial1.print("@0T100\r");
  3384.               delay(50);
  3385.               String custString = "@0M";
  3386.               custString += LD_text;
  3387.               custString += "\r";
  3388.               Serial1.print(custString);
  3389.               break;
  3390.           }
  3391.       }
  3392.        
  3393.   }
  3394.  
  3395. }
  3396.  
  3397. // ====================================================================================================================
  3398. // This function determines if MarcDuino buttons were selected and calls main processing function for FOOT controller
  3399. // ====================================================================================================================
  3400. void marcDuinoFoot()
  3401. {
  3402.    if (PS3NavFoot->PS3NavigationConnected && (PS3NavFoot->getButtonPress(UP) || PS3NavFoot->getButtonPress(DOWN) || PS3NavFoot->getButtonPress(LEFT) || PS3NavFoot->getButtonPress(RIGHT)))
  3403.    {
  3404.      
  3405.        if ((millis() - previousMarcDuinoMillis) > 1000)
  3406.        {
  3407.             marcDuinoButtonCounter = 0;
  3408.             previousMarcDuinoMillis = millis();
  3409.        }
  3410.      
  3411.        marcDuinoButtonCounter += 1;
  3412.          
  3413.    } else
  3414.    {
  3415.        return;    
  3416.    }
  3417.    
  3418.    // Clear inbound buffer of any data sent form the MarcDuino board
  3419.    while (Serial1.available()) Serial1.read();
  3420.  
  3421.     //------------------------------------
  3422.     // Send triggers for the base buttons
  3423.     //------------------------------------
  3424.     if (PS3NavFoot->getButtonPress(UP) && !PS3NavFoot->getButtonPress(CROSS) && !PS3NavFoot->getButtonPress(CIRCLE) && !PS3NavFoot->getButtonPress(L1) && !PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  3425.     {
  3426.  
  3427.        if (PS3NavDome->PS3NavigationConnected && (PS3NavDome->getButtonPress(CROSS) || PS3NavDome->getButtonPress(CIRCLE) || PS3NavDome->getButtonPress(PS)))
  3428.        {
  3429.               // Skip this section
  3430.        } else
  3431.        {    
  3432.                marcDuinoButtonPush(btnUP_type, btnUP_MD_func, btnUP_cust_MP3_num, btnUP_cust_LD_type, btnUP_cust_LD_text, btnUP_cust_panel,
  3433.                                  btnUP_use_DP1,
  3434.                                  btnUP_DP1_open_start_delay,
  3435.                                  btnUP_DP1_stay_open_time,
  3436.                                  btnUP_use_DP2,
  3437.                                  btnUP_DP2_open_start_delay,
  3438.                                  btnUP_DP2_stay_open_time,
  3439.                                  btnUP_use_DP3,
  3440.                                  btnUP_DP3_open_start_delay,
  3441.                                  btnUP_DP3_stay_open_time,
  3442.                                  btnUP_use_DP4,
  3443.                                  btnUP_DP4_open_start_delay,
  3444.                                  btnUP_DP4_stay_open_time,
  3445.                                  btnUP_use_DP5,
  3446.                                  btnUP_DP5_open_start_delay,
  3447.                                  btnUP_DP5_stay_open_time,
  3448.                                  btnUP_use_DP6,
  3449.                                  btnUP_DP6_open_start_delay,
  3450.                                  btnUP_DP6_stay_open_time,
  3451.                                  btnUP_use_DP7,
  3452.                                  btnUP_DP7_open_start_delay,
  3453.                                  btnUP_DP7_stay_open_time,
  3454.                                  btnUP_use_DP8,
  3455.                                  btnUP_DP8_open_start_delay,
  3456.                                  btnUP_DP8_stay_open_time,
  3457.                                  btnUP_use_DP9,
  3458.                                  btnUP_DP9_open_start_delay,
  3459.                                  btnUP_DP9_stay_open_time,
  3460.                                  btnUP_use_DP10,
  3461.                                  btnUP_DP10_open_start_delay,
  3462.                                  btnUP_DP10_stay_open_time);
  3463.                    
  3464.                 #ifdef SHADOW_VERBOSE      
  3465.                      output += "FOOT: btnUP";
  3466.                 #endif
  3467.                
  3468.                 return;
  3469.        
  3470.          }
  3471.        
  3472.     }
  3473.    
  3474.     if (PS3NavFoot->getButtonPress(DOWN) && !PS3NavFoot->getButtonPress(CROSS) && !PS3NavFoot->getButtonPress(CIRCLE) && !PS3NavFoot->getButtonPress(L1) && !PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  3475.     {
  3476.      
  3477.        if (PS3NavDome->PS3NavigationConnected && (PS3NavDome->getButtonPress(CROSS) || PS3NavDome->getButtonPress(CIRCLE) || PS3NavDome->getButtonPress(PS)))
  3478.        {
  3479.               // Skip this section
  3480.        } else
  3481.        {    
  3482.             marcDuinoButtonPush(btnDown_type, btnDown_MD_func, btnDown_cust_MP3_num, btnDown_cust_LD_type, btnDown_cust_LD_text, btnDown_cust_panel,
  3483.                          btnDown_use_DP1,
  3484.                          btnDown_DP1_open_start_delay,
  3485.                          btnDown_DP1_stay_open_time,
  3486.                          btnDown_use_DP2,
  3487.                          btnDown_DP2_open_start_delay,
  3488.                          btnDown_DP2_stay_open_time,
  3489.                          btnDown_use_DP3,
  3490.                          btnDown_DP3_open_start_delay,
  3491.                          btnDown_DP3_stay_open_time,
  3492.                          btnDown_use_DP4,
  3493.                          btnDown_DP4_open_start_delay,
  3494.                          btnDown_DP4_stay_open_time,
  3495.                          btnDown_use_DP5,
  3496.                          btnDown_DP5_open_start_delay,
  3497.                          btnDown_DP5_stay_open_time,
  3498.                          btnDown_use_DP6,
  3499.                          btnDown_DP6_open_start_delay,
  3500.                          btnDown_DP6_stay_open_time,
  3501.                          btnDown_use_DP7,
  3502.                          btnDown_DP7_open_start_delay,
  3503.                          btnDown_DP7_stay_open_time,
  3504.                          btnDown_use_DP8,
  3505.                          btnDown_DP8_open_start_delay,
  3506.                          btnDown_DP8_stay_open_time,
  3507.                          btnDown_use_DP9,
  3508.                          btnDown_DP9_open_start_delay,
  3509.                          btnDown_DP9_stay_open_time,
  3510.                          btnDown_use_DP10,
  3511.                          btnDown_DP10_open_start_delay,
  3512.                          btnDown_DP10_stay_open_time);
  3513.                          
  3514.         #ifdef SHADOW_VERBOSE      
  3515.              output += "FOOT: btnDown";
  3516.         #endif
  3517.      
  3518.        
  3519.         return;
  3520.        }
  3521.     }
  3522.    
  3523.     if (PS3NavFoot->getButtonPress(LEFT) && !PS3NavFoot->getButtonPress(CROSS) && !PS3NavFoot->getButtonPress(CIRCLE) && !PS3NavFoot->getButtonPress(L1) && !PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  3524.     {
  3525.        if (PS3NavDome->PS3NavigationConnected && (PS3NavDome->getButtonPress(CROSS) || PS3NavDome->getButtonPress(CIRCLE) || PS3NavDome->getButtonPress(PS)))
  3526.        {
  3527.               // Skip this section
  3528.        } else
  3529.        {          
  3530.             marcDuinoButtonPush(btnLeft_type, btnLeft_MD_func, btnLeft_cust_MP3_num, btnLeft_cust_LD_type, btnLeft_cust_LD_text, btnLeft_cust_panel,
  3531.                          btnLeft_use_DP1,
  3532.                          btnLeft_DP1_open_start_delay,
  3533.                          btnLeft_DP1_stay_open_time,
  3534.                          btnLeft_use_DP2,
  3535.                          btnLeft_DP2_open_start_delay,
  3536.                          btnLeft_DP2_stay_open_time,
  3537.                          btnLeft_use_DP3,
  3538.                          btnLeft_DP3_open_start_delay,
  3539.                          btnLeft_DP3_stay_open_time,
  3540.                          btnLeft_use_DP4,
  3541.                          btnLeft_DP4_open_start_delay,
  3542.                          btnLeft_DP4_stay_open_time,
  3543.                          btnLeft_use_DP5,
  3544.                          btnLeft_DP5_open_start_delay,
  3545.                          btnLeft_DP5_stay_open_time,
  3546.                          btnLeft_use_DP6,
  3547.                          btnLeft_DP6_open_start_delay,
  3548.                          btnLeft_DP6_stay_open_time,
  3549.                          btnLeft_use_DP7,
  3550.                          btnLeft_DP7_open_start_delay,
  3551.                          btnLeft_DP7_stay_open_time,
  3552.                          btnLeft_use_DP8,
  3553.                          btnLeft_DP8_open_start_delay,
  3554.                          btnLeft_DP8_stay_open_time,
  3555.                          btnLeft_use_DP9,
  3556.                          btnLeft_DP9_open_start_delay,
  3557.                          btnLeft_DP9_stay_open_time,
  3558.                          btnLeft_use_DP10,
  3559.                          btnLeft_DP10_open_start_delay,
  3560.                          btnLeft_DP10_stay_open_time);
  3561.                          
  3562.         #ifdef SHADOW_VERBOSE      
  3563.              output += "FOOT: btnLeft";
  3564.         #endif
  3565.        
  3566.         return;
  3567.        }
  3568.        
  3569.      }
  3570.  
  3571.     if (PS3NavFoot->getButtonPress(RIGHT) && !PS3NavFoot->getButtonPress(CROSS) && !PS3NavFoot->getButtonPress(CIRCLE) && !PS3NavFoot->getButtonPress(L1) && !PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  3572.     {
  3573.      
  3574.        if (PS3NavDome->PS3NavigationConnected && (PS3NavDome->getButtonPress(CROSS) || PS3NavDome->getButtonPress(CIRCLE) || PS3NavDome->getButtonPress(PS)))
  3575.        {
  3576.               // Skip this section
  3577.        } else
  3578.        {    
  3579.              marcDuinoButtonPush(btnRight_type, btnRight_MD_func, btnRight_cust_MP3_num, btnRight_cust_LD_type, btnRight_cust_LD_text, btnRight_cust_panel,
  3580.                          btnRight_use_DP1,
  3581.                          btnRight_DP1_open_start_delay,
  3582.                          btnRight_DP1_stay_open_time,
  3583.                          btnRight_use_DP2,
  3584.                          btnRight_DP2_open_start_delay,
  3585.                          btnRight_DP2_stay_open_time,
  3586.                          btnRight_use_DP3,
  3587.                          btnRight_DP3_open_start_delay,
  3588.                          btnRight_DP3_stay_open_time,
  3589.                          btnRight_use_DP4,
  3590.                          btnRight_DP4_open_start_delay,
  3591.                          btnRight_DP4_stay_open_time,
  3592.                          btnRight_use_DP5,
  3593.                          btnRight_DP5_open_start_delay,
  3594.                          btnRight_DP5_stay_open_time,
  3595.                          btnRight_use_DP6,
  3596.                          btnRight_DP6_open_start_delay,
  3597.                          btnRight_DP6_stay_open_time,
  3598.                          btnRight_use_DP7,
  3599.                          btnRight_DP7_open_start_delay,
  3600.                          btnRight_DP7_stay_open_time,
  3601.                          btnRight_use_DP8,
  3602.                          btnRight_DP8_open_start_delay,
  3603.                          btnRight_DP8_stay_open_time,
  3604.                          btnRight_use_DP9,
  3605.                          btnRight_DP9_open_start_delay,
  3606.                          btnRight_DP9_stay_open_time,
  3607.                          btnRight_use_DP10,
  3608.                          btnRight_DP10_open_start_delay,
  3609.                          btnRight_DP10_stay_open_time);
  3610.                          
  3611.         #ifdef SHADOW_VERBOSE      
  3612.              output += "FOOT: btnRight";
  3613.         #endif
  3614.      
  3615.        
  3616.         return;
  3617.        }
  3618.        
  3619.     }
  3620.    
  3621.     //------------------------------------
  3622.     // Send triggers for the CROSS + base buttons
  3623.     //------------------------------------
  3624.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(UP) && PS3NavFoot->getButtonPress(CROSS)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(UP) && PS3NavDome->getButtonPress(CROSS))) && marcDuinoButtonCounter == 1)
  3625.     {
  3626.      
  3627.        marcDuinoButtonPush(btnUP_CROSS_type, btnUP_CROSS_MD_func, btnUP_CROSS_cust_MP3_num, btnUP_CROSS_cust_LD_type, btnUP_CROSS_cust_LD_text, btnUP_CROSS_cust_panel,
  3628.                          btnUP_CROSS_use_DP1,
  3629.                          btnUP_CROSS_DP1_open_start_delay,
  3630.                          btnUP_CROSS_DP1_stay_open_time,
  3631.                          btnUP_CROSS_use_DP2,
  3632.                          btnUP_CROSS_DP2_open_start_delay,
  3633.                          btnUP_CROSS_DP2_stay_open_time,
  3634.                          btnUP_CROSS_use_DP3,
  3635.                          btnUP_CROSS_DP3_open_start_delay,
  3636.                          btnUP_CROSS_DP3_stay_open_time,
  3637.                          btnUP_CROSS_use_DP4,
  3638.                          btnUP_CROSS_DP4_open_start_delay,
  3639.                          btnUP_CROSS_DP4_stay_open_time,
  3640.                          btnUP_CROSS_use_DP5,
  3641.                          btnUP_CROSS_DP5_open_start_delay,
  3642.                          btnUP_CROSS_DP5_stay_open_time,
  3643.                          btnUP_CROSS_use_DP6,
  3644.                          btnUP_CROSS_DP6_open_start_delay,
  3645.                          btnUP_CROSS_DP6_stay_open_time,
  3646.                          btnUP_CROSS_use_DP7,
  3647.                          btnUP_CROSS_DP7_open_start_delay,
  3648.                          btnUP_CROSS_DP7_stay_open_time,
  3649.                          btnUP_CROSS_use_DP8,
  3650.                          btnUP_CROSS_DP8_open_start_delay,
  3651.                          btnUP_CROSS_DP8_stay_open_time,
  3652.                          btnUP_CROSS_use_DP9,
  3653.                          btnUP_CROSS_DP9_open_start_delay,
  3654.                          btnUP_CROSS_DP9_stay_open_time,
  3655.                          btnUP_CROSS_use_DP10,
  3656.                          btnUP_CROSS_DP10_open_start_delay,
  3657.                          btnUP_CROSS_DP10_stay_open_time);
  3658.      
  3659.         #ifdef SHADOW_VERBOSE      
  3660.              output += "FOOT: btnUP_CROSS";
  3661.         #endif
  3662.      
  3663.        
  3664.         return;
  3665.        
  3666.     }
  3667.    
  3668.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(DOWN) && PS3NavFoot->getButtonPress(CROSS)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(DOWN) && PS3NavDome->getButtonPress(CROSS))) && marcDuinoButtonCounter == 1)
  3669.     {
  3670.      
  3671.        marcDuinoButtonPush(btnDown_CROSS_type, btnDown_CROSS_MD_func, btnDown_CROSS_cust_MP3_num, btnDown_CROSS_cust_LD_type, btnDown_CROSS_cust_LD_text, btnDown_CROSS_cust_panel,
  3672.                          btnDown_CROSS_use_DP1,
  3673.                          btnDown_CROSS_DP1_open_start_delay,
  3674.                          btnDown_CROSS_DP1_stay_open_time,
  3675.                          btnDown_CROSS_use_DP2,
  3676.                          btnDown_CROSS_DP2_open_start_delay,
  3677.                          btnDown_CROSS_DP2_stay_open_time,
  3678.                          btnDown_CROSS_use_DP3,
  3679.                          btnDown_CROSS_DP3_open_start_delay,
  3680.                          btnDown_CROSS_DP3_stay_open_time,
  3681.                          btnDown_CROSS_use_DP4,
  3682.                          btnDown_CROSS_DP4_open_start_delay,
  3683.                          btnDown_CROSS_DP4_stay_open_time,
  3684.                          btnDown_CROSS_use_DP5,
  3685.                          btnDown_CROSS_DP5_open_start_delay,
  3686.                          btnDown_CROSS_DP5_stay_open_time,
  3687.                          btnDown_CROSS_use_DP6,
  3688.                          btnDown_CROSS_DP6_open_start_delay,
  3689.                          btnDown_CROSS_DP6_stay_open_time,
  3690.                          btnDown_CROSS_use_DP7,
  3691.                          btnDown_CROSS_DP7_open_start_delay,
  3692.                          btnDown_CROSS_DP7_stay_open_time,
  3693.                          btnDown_CROSS_use_DP8,
  3694.                          btnDown_CROSS_DP8_open_start_delay,
  3695.                          btnDown_CROSS_DP8_stay_open_time,
  3696.                          btnDown_CROSS_use_DP9,
  3697.                          btnDown_CROSS_DP9_open_start_delay,
  3698.                          btnDown_CROSS_DP9_stay_open_time,
  3699.                          btnDown_CROSS_use_DP10,
  3700.                          btnDown_CROSS_DP10_open_start_delay,
  3701.                          btnDown_CROSS_DP10_stay_open_time);
  3702.                    
  3703.         #ifdef SHADOW_VERBOSE      
  3704.              output += "FOOT: btnDown_CROSS";
  3705.         #endif
  3706.      
  3707.        
  3708.         return;
  3709.        
  3710.     }
  3711.    
  3712.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(LEFT) && PS3NavFoot->getButtonPress(CROSS)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(LEFT) && PS3NavDome->getButtonPress(CROSS))) && marcDuinoButtonCounter == 1)
  3713.     {
  3714.      
  3715.        marcDuinoButtonPush(btnLeft_CROSS_type, btnLeft_CROSS_MD_func, btnLeft_CROSS_cust_MP3_num, btnLeft_CROSS_cust_LD_type, btnLeft_CROSS_cust_LD_text, btnLeft_CROSS_cust_panel,
  3716.                          btnLeft_CROSS_use_DP1,
  3717.                          btnLeft_CROSS_DP1_open_start_delay,
  3718.                          btnLeft_CROSS_DP1_stay_open_time,
  3719.                          btnLeft_CROSS_use_DP2,
  3720.                          btnLeft_CROSS_DP2_open_start_delay,
  3721.                          btnLeft_CROSS_DP2_stay_open_time,
  3722.                          btnLeft_CROSS_use_DP3,
  3723.                          btnLeft_CROSS_DP3_open_start_delay,
  3724.                          btnLeft_CROSS_DP3_stay_open_time,
  3725.                          btnLeft_CROSS_use_DP4,
  3726.                          btnLeft_CROSS_DP4_open_start_delay,
  3727.                          btnLeft_CROSS_DP4_stay_open_time,
  3728.                          btnLeft_CROSS_use_DP5,
  3729.                          btnLeft_CROSS_DP5_open_start_delay,
  3730.                          btnLeft_CROSS_DP5_stay_open_time,
  3731.                          btnLeft_CROSS_use_DP6,
  3732.                          btnLeft_CROSS_DP6_open_start_delay,
  3733.                          btnLeft_CROSS_DP6_stay_open_time,
  3734.                          btnLeft_CROSS_use_DP7,
  3735.                          btnLeft_CROSS_DP7_open_start_delay,
  3736.                          btnLeft_CROSS_DP7_stay_open_time,
  3737.                          btnLeft_CROSS_use_DP8,
  3738.                          btnLeft_CROSS_DP8_open_start_delay,
  3739.                          btnLeft_CROSS_DP8_stay_open_time,
  3740.                          btnLeft_CROSS_use_DP9,
  3741.                          btnLeft_CROSS_DP9_open_start_delay,
  3742.                          btnLeft_CROSS_DP9_stay_open_time,
  3743.                          btnLeft_CROSS_use_DP10,
  3744.                          btnLeft_CROSS_DP10_open_start_delay,
  3745.                          btnLeft_CROSS_DP10_stay_open_time);
  3746.            
  3747.         #ifdef SHADOW_VERBOSE      
  3748.              output += "FOOT: btnLeft_CROSS";
  3749.         #endif
  3750.      
  3751.        
  3752.         return;
  3753.        
  3754.     }
  3755.  
  3756.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(RIGHT) && PS3NavFoot->getButtonPress(CROSS)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(RIGHT) && PS3NavDome->getButtonPress(CROSS))) && marcDuinoButtonCounter == 1)
  3757.     {
  3758.      
  3759.        marcDuinoButtonPush(btnRight_CROSS_type, btnRight_CROSS_MD_func, btnRight_CROSS_cust_MP3_num, btnRight_CROSS_cust_LD_type, btnRight_CROSS_cust_LD_text, btnRight_CROSS_cust_panel,
  3760.                          btnRight_CROSS_use_DP1,
  3761.                          btnRight_CROSS_DP1_open_start_delay,
  3762.                          btnRight_CROSS_DP1_stay_open_time,
  3763.                          btnRight_CROSS_use_DP2,
  3764.                          btnRight_CROSS_DP2_open_start_delay,
  3765.                          btnRight_CROSS_DP2_stay_open_time,
  3766.                          btnRight_CROSS_use_DP3,
  3767.                          btnRight_CROSS_DP3_open_start_delay,
  3768.                          btnRight_CROSS_DP3_stay_open_time,
  3769.                          btnRight_CROSS_use_DP4,
  3770.                          btnRight_CROSS_DP4_open_start_delay,
  3771.                          btnRight_CROSS_DP4_stay_open_time,
  3772.                          btnRight_CROSS_use_DP5,
  3773.                          btnRight_CROSS_DP5_open_start_delay,
  3774.                          btnRight_CROSS_DP5_stay_open_time,
  3775.                          btnRight_CROSS_use_DP6,
  3776.                          btnRight_CROSS_DP6_open_start_delay,
  3777.                          btnRight_CROSS_DP6_stay_open_time,
  3778.                          btnRight_CROSS_use_DP7,
  3779.                          btnRight_CROSS_DP7_open_start_delay,
  3780.                          btnRight_CROSS_DP7_stay_open_time,
  3781.                          btnRight_CROSS_use_DP8,
  3782.                          btnRight_CROSS_DP8_open_start_delay,
  3783.                          btnRight_CROSS_DP8_stay_open_time,
  3784.                          btnRight_CROSS_use_DP9,
  3785.                          btnRight_CROSS_DP9_open_start_delay,
  3786.                          btnRight_CROSS_DP9_stay_open_time,
  3787.                          btnRight_CROSS_use_DP10,
  3788.                          btnRight_CROSS_DP10_open_start_delay,
  3789.                          btnRight_CROSS_DP10_stay_open_time);
  3790.                    
  3791.         #ifdef SHADOW_VERBOSE      
  3792.              output += "FOOT: btnRight_CROSS";
  3793.         #endif
  3794.      
  3795.        
  3796.         return;
  3797.        
  3798.     }
  3799.  
  3800.     //------------------------------------
  3801.     // Send triggers for the CIRCLE + base buttons
  3802.     //------------------------------------
  3803.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(UP) && PS3NavFoot->getButtonPress(CIRCLE)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(UP) && PS3NavDome->getButtonPress(CIRCLE))) && marcDuinoButtonCounter == 1)
  3804.     {
  3805.      
  3806.        marcDuinoButtonPush(btnUP_CIRCLE_type, btnUP_CIRCLE_MD_func, btnUP_CIRCLE_cust_MP3_num, btnUP_CIRCLE_cust_LD_type, btnUP_CIRCLE_cust_LD_text, btnUP_CIRCLE_cust_panel,
  3807.                          btnUP_CIRCLE_use_DP1,
  3808.                          btnUP_CIRCLE_DP1_open_start_delay,
  3809.                          btnUP_CIRCLE_DP1_stay_open_time,
  3810.                          btnUP_CIRCLE_use_DP2,
  3811.                          btnUP_CIRCLE_DP2_open_start_delay,
  3812.                          btnUP_CIRCLE_DP2_stay_open_time,
  3813.                          btnUP_CIRCLE_use_DP3,
  3814.                          btnUP_CIRCLE_DP3_open_start_delay,
  3815.                          btnUP_CIRCLE_DP3_stay_open_time,
  3816.                          btnUP_CIRCLE_use_DP4,
  3817.                          btnUP_CIRCLE_DP4_open_start_delay,
  3818.                          btnUP_CIRCLE_DP4_stay_open_time,
  3819.                          btnUP_CIRCLE_use_DP5,
  3820.                          btnUP_CIRCLE_DP5_open_start_delay,
  3821.                          btnUP_CIRCLE_DP5_stay_open_time,
  3822.                          btnUP_CIRCLE_use_DP6,
  3823.                          btnUP_CIRCLE_DP6_open_start_delay,
  3824.                          btnUP_CIRCLE_DP6_stay_open_time,
  3825.                          btnUP_CIRCLE_use_DP7,
  3826.                          btnUP_CIRCLE_DP7_open_start_delay,
  3827.                          btnUP_CIRCLE_DP7_stay_open_time,
  3828.                          btnUP_CIRCLE_use_DP8,
  3829.                          btnUP_CIRCLE_DP8_open_start_delay,
  3830.                          btnUP_CIRCLE_DP8_stay_open_time,
  3831.                          btnUP_CIRCLE_use_DP9,
  3832.                          btnUP_CIRCLE_DP9_open_start_delay,
  3833.                          btnUP_CIRCLE_DP9_stay_open_time,
  3834.                          btnUP_CIRCLE_use_DP10,
  3835.                          btnUP_CIRCLE_DP10_open_start_delay,
  3836.                          btnUP_CIRCLE_DP10_stay_open_time);
  3837.                    
  3838.         #ifdef SHADOW_VERBOSE      
  3839.              output += "FOOT: btnUP_CIRCLE";
  3840.         #endif
  3841.      
  3842.        
  3843.         return;
  3844.        
  3845.     }
  3846.    
  3847.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(DOWN) && PS3NavFoot->getButtonPress(CIRCLE)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(DOWN) && PS3NavDome->getButtonPress(CIRCLE))) && marcDuinoButtonCounter == 1)
  3848.     {
  3849.      
  3850.        marcDuinoButtonPush(btnDown_CIRCLE_type, btnDown_CIRCLE_MD_func, btnDown_CIRCLE_cust_MP3_num, btnDown_CIRCLE_cust_LD_type, btnDown_CIRCLE_cust_LD_text, btnDown_CIRCLE_cust_panel,
  3851.                          btnDown_CIRCLE_use_DP1,
  3852.                          btnDown_CIRCLE_DP1_open_start_delay,
  3853.                          btnDown_CIRCLE_DP1_stay_open_time,
  3854.                          btnDown_CIRCLE_use_DP2,
  3855.                          btnDown_CIRCLE_DP2_open_start_delay,
  3856.                          btnDown_CIRCLE_DP2_stay_open_time,
  3857.                          btnDown_CIRCLE_use_DP3,
  3858.                          btnDown_CIRCLE_DP3_open_start_delay,
  3859.                          btnDown_CIRCLE_DP3_stay_open_time,
  3860.                          btnDown_CIRCLE_use_DP4,
  3861.                          btnDown_CIRCLE_DP4_open_start_delay,
  3862.                          btnDown_CIRCLE_DP4_stay_open_time,
  3863.                          btnDown_CIRCLE_use_DP5,
  3864.                          btnDown_CIRCLE_DP5_open_start_delay,
  3865.                          btnDown_CIRCLE_DP5_stay_open_time,
  3866.                          btnDown_CIRCLE_use_DP6,
  3867.                          btnDown_CIRCLE_DP6_open_start_delay,
  3868.                          btnDown_CIRCLE_DP6_stay_open_time,
  3869.                          btnDown_CIRCLE_use_DP7,
  3870.                          btnDown_CIRCLE_DP7_open_start_delay,
  3871.                          btnDown_CIRCLE_DP7_stay_open_time,
  3872.                          btnDown_CIRCLE_use_DP8,
  3873.                          btnDown_CIRCLE_DP8_open_start_delay,
  3874.                          btnDown_CIRCLE_DP8_stay_open_time,
  3875.                          btnDown_CIRCLE_use_DP9,
  3876.                          btnDown_CIRCLE_DP9_open_start_delay,
  3877.                          btnDown_CIRCLE_DP9_stay_open_time,
  3878.                          btnDown_CIRCLE_use_DP10,
  3879.                          btnDown_CIRCLE_DP10_open_start_delay,
  3880.                          btnDown_CIRCLE_DP10_stay_open_time);
  3881.                    
  3882.         #ifdef SHADOW_VERBOSE      
  3883.              output += "FOOT: btnDown_CIRCLE";
  3884.         #endif
  3885.      
  3886.        
  3887.         return;
  3888.        
  3889.     }
  3890.    
  3891.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(LEFT) && PS3NavFoot->getButtonPress(CIRCLE)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(LEFT) && PS3NavDome->getButtonPress(CIRCLE))) && marcDuinoButtonCounter == 1)
  3892.     {
  3893.      
  3894.        marcDuinoButtonPush(btnLeft_CIRCLE_type, btnLeft_CIRCLE_MD_func, btnLeft_CIRCLE_cust_MP3_num, btnLeft_CIRCLE_cust_LD_type, btnLeft_CIRCLE_cust_LD_text, btnLeft_CIRCLE_cust_panel,
  3895.                          btnLeft_CIRCLE_use_DP1,
  3896.                          btnLeft_CIRCLE_DP1_open_start_delay,
  3897.                          btnLeft_CIRCLE_DP1_stay_open_time,
  3898.                          btnLeft_CIRCLE_use_DP2,
  3899.                          btnLeft_CIRCLE_DP2_open_start_delay,
  3900.                          btnLeft_CIRCLE_DP2_stay_open_time,
  3901.                          btnLeft_CIRCLE_use_DP3,
  3902.                          btnLeft_CIRCLE_DP3_open_start_delay,
  3903.                          btnLeft_CIRCLE_DP3_stay_open_time,
  3904.                          btnLeft_CIRCLE_use_DP4,
  3905.                          btnLeft_CIRCLE_DP4_open_start_delay,
  3906.                          btnLeft_CIRCLE_DP4_stay_open_time,
  3907.                          btnLeft_CIRCLE_use_DP5,
  3908.                          btnLeft_CIRCLE_DP5_open_start_delay,
  3909.                          btnLeft_CIRCLE_DP5_stay_open_time,
  3910.                          btnLeft_CIRCLE_use_DP6,
  3911.                          btnLeft_CIRCLE_DP6_open_start_delay,
  3912.                          btnLeft_CIRCLE_DP6_stay_open_time,
  3913.                          btnLeft_CIRCLE_use_DP7,
  3914.                          btnLeft_CIRCLE_DP7_open_start_delay,
  3915.                          btnLeft_CIRCLE_DP7_stay_open_time,
  3916.                          btnLeft_CIRCLE_use_DP8,
  3917.                          btnLeft_CIRCLE_DP8_open_start_delay,
  3918.                          btnLeft_CIRCLE_DP8_stay_open_time,
  3919.                          btnLeft_CIRCLE_use_DP9,
  3920.                          btnLeft_CIRCLE_DP9_open_start_delay,
  3921.                          btnLeft_CIRCLE_DP9_stay_open_time,
  3922.                          btnLeft_CIRCLE_use_DP10,
  3923.                          btnLeft_CIRCLE_DP10_open_start_delay,
  3924.                          btnLeft_CIRCLE_DP10_stay_open_time);
  3925.                    
  3926.         #ifdef SHADOW_VERBOSE      
  3927.              output += "FOOT: btnLeft_CIRCLE";
  3928.         #endif
  3929.      
  3930.        
  3931.         return;
  3932.        
  3933.     }
  3934.  
  3935.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(RIGHT) && PS3NavFoot->getButtonPress(CIRCLE)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(RIGHT) && PS3NavDome->getButtonPress(CIRCLE))) && marcDuinoButtonCounter == 1)
  3936.     {
  3937.      
  3938.        marcDuinoButtonPush(btnRight_CIRCLE_type, btnRight_CIRCLE_MD_func, btnRight_CIRCLE_cust_MP3_num, btnRight_CIRCLE_cust_LD_type, btnRight_CIRCLE_cust_LD_text, btnRight_CIRCLE_cust_panel,
  3939.                          btnRight_CIRCLE_use_DP1,
  3940.                          btnRight_CIRCLE_DP1_open_start_delay,
  3941.                          btnRight_CIRCLE_DP1_stay_open_time,
  3942.                          btnRight_CIRCLE_use_DP2,
  3943.                          btnRight_CIRCLE_DP2_open_start_delay,
  3944.                          btnRight_CIRCLE_DP2_stay_open_time,
  3945.                          btnRight_CIRCLE_use_DP3,
  3946.                          btnRight_CIRCLE_DP3_open_start_delay,
  3947.                          btnRight_CIRCLE_DP3_stay_open_time,
  3948.                          btnRight_CIRCLE_use_DP4,
  3949.                          btnRight_CIRCLE_DP4_open_start_delay,
  3950.                          btnRight_CIRCLE_DP4_stay_open_time,
  3951.                          btnRight_CIRCLE_use_DP5,
  3952.                          btnRight_CIRCLE_DP5_open_start_delay,
  3953.                          btnRight_CIRCLE_DP5_stay_open_time,
  3954.                          btnRight_CIRCLE_use_DP6,
  3955.                          btnRight_CIRCLE_DP6_open_start_delay,
  3956.                          btnRight_CIRCLE_DP6_stay_open_time,
  3957.                          btnRight_CIRCLE_use_DP7,
  3958.                          btnRight_CIRCLE_DP7_open_start_delay,
  3959.                          btnRight_CIRCLE_DP7_stay_open_time,
  3960.                          btnRight_CIRCLE_use_DP8,
  3961.                          btnRight_CIRCLE_DP8_open_start_delay,
  3962.                          btnRight_CIRCLE_DP8_stay_open_time,
  3963.                          btnRight_CIRCLE_use_DP9,
  3964.                          btnRight_CIRCLE_DP9_open_start_delay,
  3965.                          btnRight_CIRCLE_DP9_stay_open_time,
  3966.                          btnRight_CIRCLE_use_DP10,
  3967.                          btnRight_CIRCLE_DP10_open_start_delay,
  3968.                          btnRight_CIRCLE_DP10_stay_open_time);
  3969.            
  3970.        
  3971.         #ifdef SHADOW_VERBOSE      
  3972.              output += "FOOT: btnRight_CIRCLE";
  3973.         #endif
  3974.      
  3975.        
  3976.         return;
  3977.        
  3978.     }
  3979.    
  3980.     //------------------------------------
  3981.     // Send triggers for the L1 + base buttons
  3982.     //------------------------------------
  3983.     if (PS3NavFoot->getButtonPress(UP) && PS3NavFoot->getButtonPress(L1) && marcDuinoButtonCounter == 1)
  3984.     {
  3985.      
  3986.        marcDuinoButtonPush(btnUP_L1_type, btnUP_L1_MD_func, btnUP_L1_cust_MP3_num, btnUP_L1_cust_LD_type, btnUP_L1_cust_LD_text, btnUP_L1_cust_panel,
  3987.                          btnUP_L1_use_DP1,
  3988.                          btnUP_L1_DP1_open_start_delay,
  3989.                          btnUP_L1_DP1_stay_open_time,
  3990.                          btnUP_L1_use_DP2,
  3991.                          btnUP_L1_DP2_open_start_delay,
  3992.                          btnUP_L1_DP2_stay_open_time,
  3993.                          btnUP_L1_use_DP3,
  3994.                          btnUP_L1_DP3_open_start_delay,
  3995.                          btnUP_L1_DP3_stay_open_time,
  3996.                          btnUP_L1_use_DP4,
  3997.                          btnUP_L1_DP4_open_start_delay,
  3998.                          btnUP_L1_DP4_stay_open_time,
  3999.                          btnUP_L1_use_DP5,
  4000.                          btnUP_L1_DP5_open_start_delay,
  4001.                          btnUP_L1_DP5_stay_open_time,
  4002.                          btnUP_L1_use_DP6,
  4003.                          btnUP_L1_DP6_open_start_delay,
  4004.                          btnUP_L1_DP6_stay_open_time,
  4005.                          btnUP_L1_use_DP7,
  4006.                          btnUP_L1_DP7_open_start_delay,
  4007.                          btnUP_L1_DP7_stay_open_time,
  4008.                          btnUP_L1_use_DP8,
  4009.                          btnUP_L1_DP8_open_start_delay,
  4010.                          btnUP_L1_DP8_stay_open_time,
  4011.                          btnUP_L1_use_DP9,
  4012.                          btnUP_L1_DP9_open_start_delay,
  4013.                          btnUP_L1_DP9_stay_open_time,
  4014.                          btnUP_L1_use_DP10,
  4015.                          btnUP_L1_DP10_open_start_delay,
  4016.                          btnUP_L1_DP10_stay_open_time);
  4017.            
  4018.         #ifdef SHADOW_VERBOSE      
  4019.              output += "FOOT: btnUP_L1";
  4020.         #endif
  4021.      
  4022.        
  4023.         return;
  4024.        
  4025.     }
  4026.    
  4027.     if (PS3NavFoot->getButtonPress(DOWN) && PS3NavFoot->getButtonPress(L1) && marcDuinoButtonCounter == 1)
  4028.     {
  4029.      
  4030.        marcDuinoButtonPush(btnDown_L1_type, btnDown_L1_MD_func, btnDown_L1_cust_MP3_num, btnDown_L1_cust_LD_type, btnDown_L1_cust_LD_text, btnDown_L1_cust_panel,
  4031.                          btnDown_L1_use_DP1,
  4032.                          btnDown_L1_DP1_open_start_delay,
  4033.                          btnDown_L1_DP1_stay_open_time,
  4034.                          btnDown_L1_use_DP2,
  4035.                          btnDown_L1_DP2_open_start_delay,
  4036.                          btnDown_L1_DP2_stay_open_time,
  4037.                          btnDown_L1_use_DP3,
  4038.                          btnDown_L1_DP3_open_start_delay,
  4039.                          btnDown_L1_DP3_stay_open_time,
  4040.                          btnDown_L1_use_DP4,
  4041.                          btnDown_L1_DP4_open_start_delay,
  4042.                          btnDown_L1_DP4_stay_open_time,
  4043.                          btnDown_L1_use_DP5,
  4044.                          btnDown_L1_DP5_open_start_delay,
  4045.                          btnDown_L1_DP5_stay_open_time,
  4046.                          btnDown_L1_use_DP6,
  4047.                          btnDown_L1_DP6_open_start_delay,
  4048.                          btnDown_L1_DP6_stay_open_time,
  4049.                          btnDown_L1_use_DP7,
  4050.                          btnDown_L1_DP7_open_start_delay,
  4051.                          btnDown_L1_DP7_stay_open_time,
  4052.                          btnDown_L1_use_DP8,
  4053.                          btnDown_L1_DP8_open_start_delay,
  4054.                          btnDown_L1_DP8_stay_open_time,
  4055.                          btnDown_L1_use_DP9,
  4056.                          btnDown_L1_DP9_open_start_delay,
  4057.                          btnDown_L1_DP9_stay_open_time,
  4058.                          btnDown_L1_use_DP10,
  4059.                          btnDown_L1_DP10_open_start_delay,
  4060.                          btnDown_L1_DP10_stay_open_time);
  4061.                    
  4062.         #ifdef SHADOW_VERBOSE      
  4063.              output += "FOOT: btnDown_L1";
  4064.         #endif
  4065.      
  4066.        
  4067.         return;
  4068.        
  4069.     }
  4070.    
  4071.     if (PS3NavFoot->getButtonPress(LEFT) && PS3NavFoot->getButtonPress(L1) && marcDuinoButtonCounter == 1)
  4072.     {
  4073.      
  4074.        marcDuinoButtonPush(btnLeft_L1_type, btnLeft_L1_MD_func, btnLeft_L1_cust_MP3_num, btnLeft_L1_cust_LD_type, btnLeft_L1_cust_LD_text, btnLeft_L1_cust_panel,
  4075.                          btnLeft_L1_use_DP1,
  4076.                          btnLeft_L1_DP1_open_start_delay,
  4077.                          btnLeft_L1_DP1_stay_open_time,
  4078.                          btnLeft_L1_use_DP2,
  4079.                          btnLeft_L1_DP2_open_start_delay,
  4080.                          btnLeft_L1_DP2_stay_open_time,
  4081.                          btnLeft_L1_use_DP3,
  4082.                          btnLeft_L1_DP3_open_start_delay,
  4083.                          btnLeft_L1_DP3_stay_open_time,
  4084.                          btnLeft_L1_use_DP4,
  4085.                          btnLeft_L1_DP4_open_start_delay,
  4086.                          btnLeft_L1_DP4_stay_open_time,
  4087.                          btnLeft_L1_use_DP5,
  4088.                          btnLeft_L1_DP5_open_start_delay,
  4089.                          btnLeft_L1_DP5_stay_open_time,
  4090.                          btnLeft_L1_use_DP6,
  4091.                          btnLeft_L1_DP6_open_start_delay,
  4092.                          btnLeft_L1_DP6_stay_open_time,
  4093.                          btnLeft_L1_use_DP7,
  4094.                          btnLeft_L1_DP7_open_start_delay,
  4095.                          btnLeft_L1_DP7_stay_open_time,
  4096.                          btnLeft_L1_use_DP8,
  4097.                          btnLeft_L1_DP8_open_start_delay,
  4098.                          btnLeft_L1_DP8_stay_open_time,
  4099.                          btnLeft_L1_use_DP9,
  4100.                          btnLeft_L1_DP9_open_start_delay,
  4101.                          btnLeft_L1_DP9_stay_open_time,
  4102.                          btnLeft_L1_use_DP10,
  4103.                          btnLeft_L1_DP10_open_start_delay,
  4104.                          btnLeft_L1_DP10_stay_open_time);
  4105.                    
  4106.         #ifdef SHADOW_VERBOSE      
  4107.              output += "FOOT: btnLeft_L1";
  4108.         #endif
  4109.      
  4110.        
  4111.         return;
  4112.        
  4113.     }
  4114.  
  4115.     if (PS3NavFoot->getButtonPress(RIGHT) && PS3NavFoot->getButtonPress(L1) && marcDuinoButtonCounter == 1)
  4116.     {
  4117.      
  4118.        marcDuinoButtonPush(btnRight_L1_type, btnRight_L1_MD_func, btnRight_L1_cust_MP3_num, btnRight_L1_cust_LD_type, btnRight_L1_cust_LD_text, btnRight_L1_cust_panel,
  4119.                          btnRight_L1_use_DP1,
  4120.                          btnRight_L1_DP1_open_start_delay,
  4121.                          btnRight_L1_DP1_stay_open_time,
  4122.                          btnRight_L1_use_DP2,
  4123.                          btnRight_L1_DP2_open_start_delay,
  4124.                          btnRight_L1_DP2_stay_open_time,
  4125.                          btnRight_L1_use_DP3,
  4126.                          btnRight_L1_DP3_open_start_delay,
  4127.                          btnRight_L1_DP3_stay_open_time,
  4128.                          btnRight_L1_use_DP4,
  4129.                          btnRight_L1_DP4_open_start_delay,
  4130.                          btnRight_L1_DP4_stay_open_time,
  4131.                          btnRight_L1_use_DP5,
  4132.                          btnRight_L1_DP5_open_start_delay,
  4133.                          btnRight_L1_DP5_stay_open_time,
  4134.                          btnRight_L1_use_DP6,
  4135.                          btnRight_L1_DP6_open_start_delay,
  4136.                          btnRight_L1_DP6_stay_open_time,
  4137.                          btnRight_L1_use_DP7,
  4138.                          btnRight_L1_DP7_open_start_delay,
  4139.                          btnRight_L1_DP7_stay_open_time,
  4140.                          btnRight_L1_use_DP8,
  4141.                          btnRight_L1_DP8_open_start_delay,
  4142.                          btnRight_L1_DP8_stay_open_time,
  4143.                          btnRight_L1_use_DP9,
  4144.                          btnRight_L1_DP9_open_start_delay,
  4145.                          btnRight_L1_DP9_stay_open_time,
  4146.                          btnRight_L1_use_DP10,
  4147.                          btnRight_L1_DP10_open_start_delay,
  4148.                          btnRight_L1_DP10_stay_open_time);
  4149.                    
  4150.         #ifdef SHADOW_VERBOSE      
  4151.              output += "FOOT: btnRight_L1";
  4152.         #endif
  4153.      
  4154.        
  4155.         return;
  4156.        
  4157.     }
  4158.    
  4159.     //------------------------------------
  4160.     // Send triggers for the PS + base buttons
  4161.     //------------------------------------
  4162.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(UP) && PS3NavFoot->getButtonPress(PS)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(UP) && PS3NavDome->getButtonPress(PS))) && marcDuinoButtonCounter == 1)
  4163.     {
  4164.      
  4165.        marcDuinoButtonPush(btnUP_PS_type, btnUP_PS_MD_func, btnUP_PS_cust_MP3_num, btnUP_PS_cust_LD_type, btnUP_PS_cust_LD_text, btnUP_PS_cust_panel,
  4166.                          btnUP_PS_use_DP1,
  4167.                          btnUP_PS_DP1_open_start_delay,
  4168.                          btnUP_PS_DP1_stay_open_time,
  4169.                          btnUP_PS_use_DP2,
  4170.                          btnUP_PS_DP2_open_start_delay,
  4171.                          btnUP_PS_DP2_stay_open_time,
  4172.                          btnUP_PS_use_DP3,
  4173.                          btnUP_PS_DP3_open_start_delay,
  4174.                          btnUP_PS_DP3_stay_open_time,
  4175.                          btnUP_PS_use_DP4,
  4176.                          btnUP_PS_DP4_open_start_delay,
  4177.                          btnUP_PS_DP4_stay_open_time,
  4178.                          btnUP_PS_use_DP5,
  4179.                          btnUP_PS_DP5_open_start_delay,
  4180.                          btnUP_PS_DP5_stay_open_time,
  4181.                          btnUP_PS_use_DP6,
  4182.                          btnUP_PS_DP6_open_start_delay,
  4183.                          btnUP_PS_DP6_stay_open_time,
  4184.                          btnUP_PS_use_DP7,
  4185.                          btnUP_PS_DP7_open_start_delay,
  4186.                          btnUP_PS_DP7_stay_open_time,
  4187.                          btnUP_PS_use_DP8,
  4188.                          btnUP_PS_DP8_open_start_delay,
  4189.                          btnUP_PS_DP8_stay_open_time,
  4190.                          btnUP_PS_use_DP9,
  4191.                          btnUP_PS_DP9_open_start_delay,
  4192.                          btnUP_PS_DP9_stay_open_time,
  4193.                          btnUP_PS_use_DP10,
  4194.                          btnUP_PS_DP10_open_start_delay,
  4195.                          btnUP_PS_DP10_stay_open_time);
  4196.            
  4197.         #ifdef SHADOW_VERBOSE      
  4198.              output += "FOOT: btnUP_PS";
  4199.         #endif
  4200.      
  4201.        
  4202.         return;
  4203.        
  4204.     }
  4205.    
  4206.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(DOWN) && PS3NavFoot->getButtonPress(PS)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(DOWN) && PS3NavDome->getButtonPress(PS))) && marcDuinoButtonCounter == 1)
  4207.     {
  4208.      
  4209.        marcDuinoButtonPush(btnDown_PS_type, btnDown_PS_MD_func, btnDown_PS_cust_MP3_num, btnDown_PS_cust_LD_type, btnDown_PS_cust_LD_text, btnDown_PS_cust_panel,
  4210.                          btnDown_PS_use_DP1,
  4211.                          btnDown_PS_DP1_open_start_delay,
  4212.                          btnDown_PS_DP1_stay_open_time,
  4213.                          btnDown_PS_use_DP2,
  4214.                          btnDown_PS_DP2_open_start_delay,
  4215.                          btnDown_PS_DP2_stay_open_time,
  4216.                          btnDown_PS_use_DP3,
  4217.                          btnDown_PS_DP3_open_start_delay,
  4218.                          btnDown_PS_DP3_stay_open_time,
  4219.                          btnDown_PS_use_DP4,
  4220.                          btnDown_PS_DP4_open_start_delay,
  4221.                          btnDown_PS_DP4_stay_open_time,
  4222.                          btnDown_PS_use_DP5,
  4223.                          btnDown_PS_DP5_open_start_delay,
  4224.                          btnDown_PS_DP5_stay_open_time,
  4225.                          btnDown_PS_use_DP6,
  4226.                          btnDown_PS_DP6_open_start_delay,
  4227.                          btnDown_PS_DP6_stay_open_time,
  4228.                          btnDown_PS_use_DP7,
  4229.                          btnDown_PS_DP7_open_start_delay,
  4230.                          btnDown_PS_DP7_stay_open_time,
  4231.                          btnDown_PS_use_DP8,
  4232.                          btnDown_PS_DP8_open_start_delay,
  4233.                          btnDown_PS_DP8_stay_open_time,
  4234.                          btnDown_PS_use_DP9,
  4235.                          btnDown_PS_DP9_open_start_delay,
  4236.                          btnDown_PS_DP9_stay_open_time,
  4237.                          btnDown_PS_use_DP10,
  4238.                          btnDown_PS_DP10_open_start_delay,
  4239.                          btnDown_PS_DP10_stay_open_time);
  4240.                    
  4241.         #ifdef SHADOW_VERBOSE      
  4242.              output += "FOOT: btnDown_PS";
  4243.         #endif
  4244.      
  4245.        
  4246.         return;
  4247.        
  4248.     }
  4249.    
  4250.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(LEFT) && PS3NavFoot->getButtonPress(PS)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(LEFT) && PS3NavDome->getButtonPress(PS))) && marcDuinoButtonCounter == 1)
  4251.     {
  4252.      
  4253.        marcDuinoButtonPush(btnLeft_PS_type, btnLeft_PS_MD_func, btnLeft_PS_cust_MP3_num, btnLeft_PS_cust_LD_type, btnLeft_PS_cust_LD_text, btnLeft_PS_cust_panel,
  4254.                          btnLeft_PS_use_DP1,
  4255.                          btnLeft_PS_DP1_open_start_delay,
  4256.                          btnLeft_PS_DP1_stay_open_time,
  4257.                          btnLeft_PS_use_DP2,
  4258.                          btnLeft_PS_DP2_open_start_delay,
  4259.                          btnLeft_PS_DP2_stay_open_time,
  4260.                          btnLeft_PS_use_DP3,
  4261.                          btnLeft_PS_DP3_open_start_delay,
  4262.                          btnLeft_PS_DP3_stay_open_time,
  4263.                          btnLeft_PS_use_DP4,
  4264.                          btnLeft_PS_DP4_open_start_delay,
  4265.                          btnLeft_PS_DP4_stay_open_time,
  4266.                          btnLeft_PS_use_DP5,
  4267.                          btnLeft_PS_DP5_open_start_delay,
  4268.                          btnLeft_PS_DP5_stay_open_time,
  4269.                          btnLeft_PS_use_DP6,
  4270.                          btnLeft_PS_DP6_open_start_delay,
  4271.                          btnLeft_PS_DP6_stay_open_time,
  4272.                          btnLeft_PS_use_DP7,
  4273.                          btnLeft_PS_DP7_open_start_delay,
  4274.                          btnLeft_PS_DP7_stay_open_time,
  4275.                          btnLeft_PS_use_DP8,
  4276.                          btnLeft_PS_DP8_open_start_delay,
  4277.                          btnLeft_PS_DP8_stay_open_time,
  4278.                          btnLeft_PS_use_DP9,
  4279.                          btnLeft_PS_DP9_open_start_delay,
  4280.                          btnLeft_PS_DP9_stay_open_time,
  4281.                          btnLeft_PS_use_DP10,
  4282.                          btnLeft_PS_DP10_open_start_delay,
  4283.                          btnLeft_PS_DP10_stay_open_time);
  4284.            
  4285.         #ifdef SHADOW_VERBOSE      
  4286.              output += "FOOT: btnLeft_PS";
  4287.         #endif
  4288.      
  4289.        
  4290.         return;
  4291.        
  4292.     }
  4293.  
  4294.     if (((!PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(RIGHT) && PS3NavFoot->getButtonPress(PS)) || (PS3NavDome->PS3NavigationConnected && PS3NavFoot->getButtonPress(RIGHT) && PS3NavDome->getButtonPress(PS))) && marcDuinoButtonCounter == 1)
  4295.     {
  4296.      
  4297.        marcDuinoButtonPush(btnRight_PS_type, btnRight_PS_MD_func, btnRight_PS_cust_MP3_num, btnRight_PS_cust_LD_type, btnRight_PS_cust_LD_text, btnRight_PS_cust_panel,
  4298.                          btnRight_PS_use_DP1,
  4299.                          btnRight_PS_DP1_open_start_delay,
  4300.                          btnRight_PS_DP1_stay_open_time,
  4301.                          btnRight_PS_use_DP2,
  4302.                          btnRight_PS_DP2_open_start_delay,
  4303.                          btnRight_PS_DP2_stay_open_time,
  4304.                          btnRight_PS_use_DP3,
  4305.                          btnRight_PS_DP3_open_start_delay,
  4306.                          btnRight_PS_DP3_stay_open_time,
  4307.                          btnRight_PS_use_DP4,
  4308.                          btnRight_PS_DP4_open_start_delay,
  4309.                          btnRight_PS_DP4_stay_open_time,
  4310.                          btnRight_PS_use_DP5,
  4311.                          btnRight_PS_DP5_open_start_delay,
  4312.                          btnRight_PS_DP5_stay_open_time,
  4313.                          btnRight_PS_use_DP6,
  4314.                          btnRight_PS_DP6_open_start_delay,
  4315.                          btnRight_PS_DP6_stay_open_time,
  4316.                          btnRight_PS_use_DP7,
  4317.                          btnRight_PS_DP7_open_start_delay,
  4318.                          btnRight_PS_DP7_stay_open_time,
  4319.                          btnRight_PS_use_DP8,
  4320.                          btnRight_PS_DP8_open_start_delay,
  4321.                          btnRight_PS_DP8_stay_open_time,
  4322.                          btnRight_PS_use_DP9,
  4323.                          btnRight_PS_DP9_open_start_delay,
  4324.                          btnRight_PS_DP9_stay_open_time,
  4325.                          btnRight_PS_use_DP10,
  4326.                          btnRight_PS_DP10_open_start_delay,
  4327.                          btnRight_PS_DP10_stay_open_time);
  4328.                    
  4329.         #ifdef SHADOW_VERBOSE      
  4330.              output += "FOOT: btnRight_PS";
  4331.         #endif
  4332.      
  4333.        
  4334.         return;
  4335.        
  4336.     }
  4337.  
  4338. }
  4339.  
  4340. // ===================================================================================================================
  4341. // This function determines if MarcDuino buttons were selected and calls main processing function for DOME Controller
  4342. // ===================================================================================================================
  4343. void marcDuinoDome()
  4344. {
  4345.    if (PS3NavDome->PS3NavigationConnected && (PS3NavDome->getButtonPress(UP) || PS3NavDome->getButtonPress(DOWN) || PS3NavDome->getButtonPress(LEFT) || PS3NavDome->getButtonPress(RIGHT)))
  4346.    {
  4347.      
  4348.        if ((millis() - previousMarcDuinoMillis) > 1000)
  4349.        {
  4350.             marcDuinoButtonCounter = 0;
  4351.             previousMarcDuinoMillis = millis();
  4352.        }
  4353.      
  4354.        marcDuinoButtonCounter += 1;
  4355.          
  4356.    } else
  4357.    {
  4358.        return;    
  4359.    }
  4360.    
  4361.    // Clear inbound buffer of any data sent form the MarcDuino board
  4362.    while (Serial1.available()) Serial1.read();
  4363.  
  4364.     //------------------------------------
  4365.     // Send triggers for the base buttons
  4366.     //------------------------------------
  4367.     if (PS3NavDome->getButtonPress(UP) && !PS3NavDome->getButtonPress(CROSS) && !PS3NavDome->getButtonPress(CIRCLE) && !PS3NavDome->getButtonPress(L1) && !PS3NavDome->getButtonPress(PS) && !PS3NavFoot->getButtonPress(CROSS) && !PS3NavFoot->getButtonPress(CIRCLE) && !PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  4368.     {
  4369.      
  4370.        marcDuinoButtonPush(1, FTbtnUP_MD_func, btnUP_cust_MP3_num, btnUP_cust_LD_type, btnUP_cust_LD_text, btnUP_cust_panel,
  4371.                          btnUP_use_DP1,
  4372.                          btnUP_DP1_open_start_delay,
  4373.                          btnUP_DP1_stay_open_time,
  4374.                          btnUP_use_DP2,
  4375.                          btnUP_DP2_open_start_delay,
  4376.                          btnUP_DP2_stay_open_time,
  4377.                          btnUP_use_DP3,
  4378.                          btnUP_DP3_open_start_delay,
  4379.                          btnUP_DP3_stay_open_time,
  4380.                          btnUP_use_DP4,
  4381.                          btnUP_DP4_open_start_delay,
  4382.                          btnUP_DP4_stay_open_time,
  4383.                          btnUP_use_DP5,
  4384.                          btnUP_DP5_open_start_delay,
  4385.                          btnUP_DP5_stay_open_time,
  4386.                          btnUP_use_DP6,
  4387.                          btnUP_DP6_open_start_delay,
  4388.                          btnUP_DP6_stay_open_time,
  4389.                          btnUP_use_DP7,
  4390.                          btnUP_DP7_open_start_delay,
  4391.                          btnUP_DP7_stay_open_time,
  4392.                          btnUP_use_DP8,
  4393.                          btnUP_DP8_open_start_delay,
  4394.                          btnUP_DP8_stay_open_time,
  4395.                          btnUP_use_DP9,
  4396.                          btnUP_DP9_open_start_delay,
  4397.                          btnUP_DP9_stay_open_time,
  4398.                          btnUP_use_DP10,
  4399.                          btnUP_DP10_open_start_delay,
  4400.                          btnUP_DP10_stay_open_time);
  4401.            
  4402.         #ifdef SHADOW_VERBOSE      
  4403.              output += "DOME: btnUP";
  4404.         #endif
  4405.      
  4406.         return;
  4407.        
  4408.     }
  4409.    
  4410.     if (PS3NavDome->getButtonPress(DOWN) && !PS3NavDome->getButtonPress(CROSS) && !PS3NavDome->getButtonPress(CIRCLE) && !PS3NavDome->getButtonPress(L1) && !PS3NavDome->getButtonPress(PS) && !PS3NavFoot->getButtonPress(CROSS) && !PS3NavFoot->getButtonPress(CIRCLE) && !PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  4411.     {
  4412.      
  4413.        marcDuinoButtonPush(1, FTbtnDown_MD_func, btnDown_cust_MP3_num, btnDown_cust_LD_type, btnDown_cust_LD_text, btnDown_cust_panel,
  4414.                          btnDown_use_DP1,
  4415.                          btnDown_DP1_open_start_delay,
  4416.                          btnDown_DP1_stay_open_time,
  4417.                          btnDown_use_DP2,
  4418.                          btnDown_DP2_open_start_delay,
  4419.                          btnDown_DP2_stay_open_time,
  4420.                          btnDown_use_DP3,
  4421.                          btnDown_DP3_open_start_delay,
  4422.                          btnDown_DP3_stay_open_time,
  4423.                          btnDown_use_DP4,
  4424.                          btnDown_DP4_open_start_delay,
  4425.                          btnDown_DP4_stay_open_time,
  4426.                          btnDown_use_DP5,
  4427.                          btnDown_DP5_open_start_delay,
  4428.                          btnDown_DP5_stay_open_time,
  4429.                          btnDown_use_DP6,
  4430.                          btnDown_DP6_open_start_delay,
  4431.                          btnDown_DP6_stay_open_time,
  4432.                          btnDown_use_DP7,
  4433.                          btnDown_DP7_open_start_delay,
  4434.                          btnDown_DP7_stay_open_time,
  4435.                          btnDown_use_DP8,
  4436.                          btnDown_DP8_open_start_delay,
  4437.                          btnDown_DP8_stay_open_time,
  4438.                          btnDown_use_DP9,
  4439.                          btnDown_DP9_open_start_delay,
  4440.                          btnDown_DP9_stay_open_time,
  4441.                          btnDown_use_DP10,
  4442.                          btnDown_DP10_open_start_delay,
  4443.                          btnDown_DP10_stay_open_time);
  4444.                          
  4445.         #ifdef SHADOW_VERBOSE      
  4446.              output += "DOME: btnDown";
  4447.         #endif
  4448.      
  4449.         return;      
  4450.     }
  4451.    
  4452.     if (PS3NavDome->getButtonPress(LEFT) && !PS3NavDome->getButtonPress(CROSS) && !PS3NavDome->getButtonPress(CIRCLE) && !PS3NavDome->getButtonPress(L1) && !PS3NavDome->getButtonPress(PS) && !PS3NavFoot->getButtonPress(CROSS) && !PS3NavFoot->getButtonPress(CIRCLE) && !PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  4453.     {
  4454.      
  4455.        marcDuinoButtonPush(1, FTbtnLeft_MD_func, btnLeft_cust_MP3_num, btnLeft_cust_LD_type, btnLeft_cust_LD_text, btnLeft_cust_panel,
  4456.                          btnLeft_use_DP1,
  4457.                          btnLeft_DP1_open_start_delay,
  4458.                          btnLeft_DP1_stay_open_time,
  4459.                          btnLeft_use_DP2,
  4460.                          btnLeft_DP2_open_start_delay,
  4461.                          btnLeft_DP2_stay_open_time,
  4462.                          btnLeft_use_DP3,
  4463.                          btnLeft_DP3_open_start_delay,
  4464.                          btnLeft_DP3_stay_open_time,
  4465.                          btnLeft_use_DP4,
  4466.                          btnLeft_DP4_open_start_delay,
  4467.                          btnLeft_DP4_stay_open_time,
  4468.                          btnLeft_use_DP5,
  4469.                          btnLeft_DP5_open_start_delay,
  4470.                          btnLeft_DP5_stay_open_time,
  4471.                          btnLeft_use_DP6,
  4472.                          btnLeft_DP6_open_start_delay,
  4473.                          btnLeft_DP6_stay_open_time,
  4474.                          btnLeft_use_DP7,
  4475.                          btnLeft_DP7_open_start_delay,
  4476.                          btnLeft_DP7_stay_open_time,
  4477.                          btnLeft_use_DP8,
  4478.                          btnLeft_DP8_open_start_delay,
  4479.                          btnLeft_DP8_stay_open_time,
  4480.                          btnLeft_use_DP9,
  4481.                          btnLeft_DP9_open_start_delay,
  4482.                          btnLeft_DP9_stay_open_time,
  4483.                          btnLeft_use_DP10,
  4484.                          btnLeft_DP10_open_start_delay,
  4485.                          btnLeft_DP10_stay_open_time);
  4486.                          
  4487.         #ifdef SHADOW_VERBOSE      
  4488.              output += "DOME: btnLeft";
  4489.         #endif
  4490.        
  4491.         return;
  4492.        
  4493.     }
  4494.  
  4495.     if (PS3NavDome->getButtonPress(RIGHT) && !PS3NavDome->getButtonPress(CROSS) && !PS3NavDome->getButtonPress(CIRCLE) && !PS3NavDome->getButtonPress(L1) && !PS3NavDome->getButtonPress(PS) && !PS3NavFoot->getButtonPress(CROSS) && !PS3NavFoot->getButtonPress(CIRCLE) && !PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  4496.     {
  4497.      
  4498.        marcDuinoButtonPush(1, FTbtnRight_MD_func, btnRight_cust_MP3_num, btnRight_cust_LD_type, btnRight_cust_LD_text, btnRight_cust_panel,
  4499.                          btnRight_use_DP1,
  4500.                          btnRight_DP1_open_start_delay,
  4501.                          btnRight_DP1_stay_open_time,
  4502.                          btnRight_use_DP2,
  4503.                          btnRight_DP2_open_start_delay,
  4504.                          btnRight_DP2_stay_open_time,
  4505.                          btnRight_use_DP3,
  4506.                          btnRight_DP3_open_start_delay,
  4507.                          btnRight_DP3_stay_open_time,
  4508.                          btnRight_use_DP4,
  4509.                          btnRight_DP4_open_start_delay,
  4510.                          btnRight_DP4_stay_open_time,
  4511.                          btnRight_use_DP5,
  4512.                          btnRight_DP5_open_start_delay,
  4513.                          btnRight_DP5_stay_open_time,
  4514.                          btnRight_use_DP6,
  4515.                          btnRight_DP6_open_start_delay,
  4516.                          btnRight_DP6_stay_open_time,
  4517.                          btnRight_use_DP7,
  4518.                          btnRight_DP7_open_start_delay,
  4519.                          btnRight_DP7_stay_open_time,
  4520.                          btnRight_use_DP8,
  4521.                          btnRight_DP8_open_start_delay,
  4522.                          btnRight_DP8_stay_open_time,
  4523.                          btnRight_use_DP9,
  4524.                          btnRight_DP9_open_start_delay,
  4525.                          btnRight_DP9_stay_open_time,
  4526.                          btnRight_use_DP10,
  4527.                          btnRight_DP10_open_start_delay,
  4528.                          btnRight_DP10_stay_open_time);
  4529.                          
  4530.         #ifdef SHADOW_VERBOSE      
  4531.              output += "DOME: btnRight";
  4532.         #endif
  4533.      
  4534.      
  4535.         return;
  4536.        
  4537.     }
  4538.    
  4539.     //------------------------------------
  4540.     // Send triggers for the CROSS + base buttons
  4541.     //------------------------------------
  4542.     if (PS3NavDome->getButtonPress(UP) && PS3NavFoot->getButtonPress(CROSS) && marcDuinoButtonCounter == 1)
  4543.     {
  4544.      
  4545.        marcDuinoButtonPush(1, FTbtnUP_CROSS_MD_func, btnUP_CROSS_cust_MP3_num, btnUP_CROSS_cust_LD_type, btnUP_CROSS_cust_LD_text, btnUP_CROSS_cust_panel,
  4546.                          btnUP_CROSS_use_DP1,
  4547.                          btnUP_CROSS_DP1_open_start_delay,
  4548.                          btnUP_CROSS_DP1_stay_open_time,
  4549.                          btnUP_CROSS_use_DP2,
  4550.                          btnUP_CROSS_DP2_open_start_delay,
  4551.                          btnUP_CROSS_DP2_stay_open_time,
  4552.                          btnUP_CROSS_use_DP3,
  4553.                          btnUP_CROSS_DP3_open_start_delay,
  4554.                          btnUP_CROSS_DP3_stay_open_time,
  4555.                          btnUP_CROSS_use_DP4,
  4556.                          btnUP_CROSS_DP4_open_start_delay,
  4557.                          btnUP_CROSS_DP4_stay_open_time,
  4558.                          btnUP_CROSS_use_DP5,
  4559.                          btnUP_CROSS_DP5_open_start_delay,
  4560.                          btnUP_CROSS_DP5_stay_open_time,
  4561.                          btnUP_CROSS_use_DP6,
  4562.                          btnUP_CROSS_DP6_open_start_delay,
  4563.                          btnUP_CROSS_DP6_stay_open_time,
  4564.                          btnUP_CROSS_use_DP7,
  4565.                          btnUP_CROSS_DP7_open_start_delay,
  4566.                          btnUP_CROSS_DP7_stay_open_time,
  4567.                          btnUP_CROSS_use_DP8,
  4568.                          btnUP_CROSS_DP8_open_start_delay,
  4569.                          btnUP_CROSS_DP8_stay_open_time,
  4570.                          btnUP_CROSS_use_DP9,
  4571.                          btnUP_CROSS_DP9_open_start_delay,
  4572.                          btnUP_CROSS_DP9_stay_open_time,
  4573.                          btnUP_CROSS_use_DP10,
  4574.                          btnUP_CROSS_DP10_open_start_delay,
  4575.                          btnUP_CROSS_DP10_stay_open_time);
  4576.      
  4577.         #ifdef SHADOW_VERBOSE      
  4578.              output += "DOME: btnUP_CROSS";
  4579.         #endif
  4580.      
  4581.      
  4582.         return;
  4583.        
  4584.     }
  4585.    
  4586.     if (PS3NavDome->getButtonPress(DOWN) && PS3NavFoot->getButtonPress(CROSS) && marcDuinoButtonCounter == 1)
  4587.     {
  4588.      
  4589.        marcDuinoButtonPush(1, FTbtnDown_CROSS_MD_func, btnDown_CROSS_cust_MP3_num, btnDown_CROSS_cust_LD_type, btnDown_CROSS_cust_LD_text, btnDown_CROSS_cust_panel,
  4590.                          btnDown_CROSS_use_DP1,
  4591.                          btnDown_CROSS_DP1_open_start_delay,
  4592.                          btnDown_CROSS_DP1_stay_open_time,
  4593.                          btnDown_CROSS_use_DP2,
  4594.                          btnDown_CROSS_DP2_open_start_delay,
  4595.                          btnDown_CROSS_DP2_stay_open_time,
  4596.                          btnDown_CROSS_use_DP3,
  4597.                          btnDown_CROSS_DP3_open_start_delay,
  4598.                          btnDown_CROSS_DP3_stay_open_time,
  4599.                          btnDown_CROSS_use_DP4,
  4600.                          btnDown_CROSS_DP4_open_start_delay,
  4601.                          btnDown_CROSS_DP4_stay_open_time,
  4602.                          btnDown_CROSS_use_DP5,
  4603.                          btnDown_CROSS_DP5_open_start_delay,
  4604.                          btnDown_CROSS_DP5_stay_open_time,
  4605.                          btnDown_CROSS_use_DP6,
  4606.                          btnDown_CROSS_DP6_open_start_delay,
  4607.                          btnDown_CROSS_DP6_stay_open_time,
  4608.                          btnDown_CROSS_use_DP7,
  4609.                          btnDown_CROSS_DP7_open_start_delay,
  4610.                          btnDown_CROSS_DP7_stay_open_time,
  4611.                          btnDown_CROSS_use_DP8,
  4612.                          btnDown_CROSS_DP8_open_start_delay,
  4613.                          btnDown_CROSS_DP8_stay_open_time,
  4614.                          btnDown_CROSS_use_DP9,
  4615.                          btnDown_CROSS_DP9_open_start_delay,
  4616.                          btnDown_CROSS_DP9_stay_open_time,
  4617.                          btnDown_CROSS_use_DP10,
  4618.                          btnDown_CROSS_DP10_open_start_delay,
  4619.                          btnDown_CROSS_DP10_stay_open_time);
  4620.                    
  4621.         #ifdef SHADOW_VERBOSE      
  4622.              output += "DOME: btnDown_CROSS";
  4623.         #endif
  4624.      
  4625.      
  4626.         return;
  4627.        
  4628.     }
  4629.    
  4630.     if (PS3NavDome->getButtonPress(LEFT) && PS3NavFoot->getButtonPress(CROSS) && marcDuinoButtonCounter == 1)
  4631.     {
  4632.      
  4633.        marcDuinoButtonPush(1, FTbtnLeft_CROSS_MD_func, btnLeft_CROSS_cust_MP3_num, btnLeft_CROSS_cust_LD_type, btnLeft_CROSS_cust_LD_text, btnLeft_CROSS_cust_panel,
  4634.                          btnLeft_CROSS_use_DP1,
  4635.                          btnLeft_CROSS_DP1_open_start_delay,
  4636.                          btnLeft_CROSS_DP1_stay_open_time,
  4637.                          btnLeft_CROSS_use_DP2,
  4638.                          btnLeft_CROSS_DP2_open_start_delay,
  4639.                          btnLeft_CROSS_DP2_stay_open_time,
  4640.                          btnLeft_CROSS_use_DP3,
  4641.                          btnLeft_CROSS_DP3_open_start_delay,
  4642.                          btnLeft_CROSS_DP3_stay_open_time,
  4643.                          btnLeft_CROSS_use_DP4,
  4644.                          btnLeft_CROSS_DP4_open_start_delay,
  4645.                          btnLeft_CROSS_DP4_stay_open_time,
  4646.                          btnLeft_CROSS_use_DP5,
  4647.                          btnLeft_CROSS_DP5_open_start_delay,
  4648.                          btnLeft_CROSS_DP5_stay_open_time,
  4649.                          btnLeft_CROSS_use_DP6,
  4650.                          btnLeft_CROSS_DP6_open_start_delay,
  4651.                          btnLeft_CROSS_DP6_stay_open_time,
  4652.                          btnLeft_CROSS_use_DP7,
  4653.                          btnLeft_CROSS_DP7_open_start_delay,
  4654.                          btnLeft_CROSS_DP7_stay_open_time,
  4655.                          btnLeft_CROSS_use_DP8,
  4656.                          btnLeft_CROSS_DP8_open_start_delay,
  4657.                          btnLeft_CROSS_DP8_stay_open_time,
  4658.                          btnLeft_CROSS_use_DP9,
  4659.                          btnLeft_CROSS_DP9_open_start_delay,
  4660.                          btnLeft_CROSS_DP9_stay_open_time,
  4661.                          btnLeft_CROSS_use_DP10,
  4662.                          btnLeft_CROSS_DP10_open_start_delay,
  4663.                          btnLeft_CROSS_DP10_stay_open_time);
  4664.            
  4665.         #ifdef SHADOW_VERBOSE      
  4666.              output += "DOME: btnLeft_CROSS";
  4667.         #endif
  4668.      
  4669.      
  4670.         return;
  4671.        
  4672.     }
  4673.  
  4674.     if (PS3NavDome->getButtonPress(RIGHT) && PS3NavFoot->getButtonPress(CROSS) && marcDuinoButtonCounter == 1)
  4675.     {
  4676.      
  4677.        marcDuinoButtonPush(1, FTbtnRight_CROSS_MD_func, btnRight_CROSS_cust_MP3_num, btnRight_CROSS_cust_LD_type, btnRight_CROSS_cust_LD_text, btnRight_CROSS_cust_panel,
  4678.                          btnRight_CROSS_use_DP1,
  4679.                          btnRight_CROSS_DP1_open_start_delay,
  4680.                          btnRight_CROSS_DP1_stay_open_time,
  4681.                          btnRight_CROSS_use_DP2,
  4682.                          btnRight_CROSS_DP2_open_start_delay,
  4683.                          btnRight_CROSS_DP2_stay_open_time,
  4684.                          btnRight_CROSS_use_DP3,
  4685.                          btnRight_CROSS_DP3_open_start_delay,
  4686.                          btnRight_CROSS_DP3_stay_open_time,
  4687.                          btnRight_CROSS_use_DP4,
  4688.                          btnRight_CROSS_DP4_open_start_delay,
  4689.                          btnRight_CROSS_DP4_stay_open_time,
  4690.                          btnRight_CROSS_use_DP5,
  4691.                          btnRight_CROSS_DP5_open_start_delay,
  4692.                          btnRight_CROSS_DP5_stay_open_time,
  4693.                          btnRight_CROSS_use_DP6,
  4694.                          btnRight_CROSS_DP6_open_start_delay,
  4695.                          btnRight_CROSS_DP6_stay_open_time,
  4696.                          btnRight_CROSS_use_DP7,
  4697.                          btnRight_CROSS_DP7_open_start_delay,
  4698.                          btnRight_CROSS_DP7_stay_open_time,
  4699.                          btnRight_CROSS_use_DP8,
  4700.                          btnRight_CROSS_DP8_open_start_delay,
  4701.                          btnRight_CROSS_DP8_stay_open_time,
  4702.                          btnRight_CROSS_use_DP9,
  4703.                          btnRight_CROSS_DP9_open_start_delay,
  4704.                          btnRight_CROSS_DP9_stay_open_time,
  4705.                          btnRight_CROSS_use_DP10,
  4706.                          btnRight_CROSS_DP10_open_start_delay,
  4707.                          btnRight_CROSS_DP10_stay_open_time);
  4708.                    
  4709.         #ifdef SHADOW_VERBOSE      
  4710.              output += "DOME: btnRight_CROSS";
  4711.         #endif
  4712.      
  4713.      
  4714.         return;
  4715.        
  4716.     }
  4717.  
  4718.     //------------------------------------
  4719.     // Send triggers for the CIRCLE + base buttons
  4720.     //------------------------------------
  4721.     if (PS3NavDome->getButtonPress(UP) && PS3NavFoot->getButtonPress(CIRCLE) && marcDuinoButtonCounter == 1)
  4722.     {
  4723.      
  4724.        marcDuinoButtonPush(1, FTbtnUP_CIRCLE_MD_func, btnUP_CIRCLE_cust_MP3_num, btnUP_CIRCLE_cust_LD_type, btnUP_CIRCLE_cust_LD_text, btnUP_CIRCLE_cust_panel,
  4725.                          btnUP_CIRCLE_use_DP1,
  4726.                          btnUP_CIRCLE_DP1_open_start_delay,
  4727.                          btnUP_CIRCLE_DP1_stay_open_time,
  4728.                          btnUP_CIRCLE_use_DP2,
  4729.                          btnUP_CIRCLE_DP2_open_start_delay,
  4730.                          btnUP_CIRCLE_DP2_stay_open_time,
  4731.                          btnUP_CIRCLE_use_DP3,
  4732.                          btnUP_CIRCLE_DP3_open_start_delay,
  4733.                          btnUP_CIRCLE_DP3_stay_open_time,
  4734.                          btnUP_CIRCLE_use_DP4,
  4735.                          btnUP_CIRCLE_DP4_open_start_delay,
  4736.                          btnUP_CIRCLE_DP4_stay_open_time,
  4737.                          btnUP_CIRCLE_use_DP5,
  4738.                          btnUP_CIRCLE_DP5_open_start_delay,
  4739.                          btnUP_CIRCLE_DP5_stay_open_time,
  4740.                          btnUP_CIRCLE_use_DP6,
  4741.                          btnUP_CIRCLE_DP6_open_start_delay,
  4742.                          btnUP_CIRCLE_DP6_stay_open_time,
  4743.                          btnUP_CIRCLE_use_DP7,
  4744.                          btnUP_CIRCLE_DP7_open_start_delay,
  4745.                          btnUP_CIRCLE_DP7_stay_open_time,
  4746.                          btnUP_CIRCLE_use_DP8,
  4747.                          btnUP_CIRCLE_DP8_open_start_delay,
  4748.                          btnUP_CIRCLE_DP8_stay_open_time,
  4749.                          btnUP_CIRCLE_use_DP9,
  4750.                          btnUP_CIRCLE_DP9_open_start_delay,
  4751.                          btnUP_CIRCLE_DP9_stay_open_time,
  4752.                          btnUP_CIRCLE_use_DP10,
  4753.                          btnUP_CIRCLE_DP10_open_start_delay,
  4754.                          btnUP_CIRCLE_DP10_stay_open_time);
  4755.                    
  4756.         #ifdef SHADOW_VERBOSE      
  4757.              output += "DOME: btnUP_CIRCLE";
  4758.         #endif
  4759.      
  4760.      
  4761.         return;
  4762.        
  4763.     }
  4764.    
  4765.     if (PS3NavDome->getButtonPress(DOWN) && PS3NavFoot->getButtonPress(CIRCLE) && marcDuinoButtonCounter == 1)
  4766.     {
  4767.      
  4768.        marcDuinoButtonPush(1, FTbtnDown_CIRCLE_MD_func, btnDown_CIRCLE_cust_MP3_num, btnDown_CIRCLE_cust_LD_type, btnDown_CIRCLE_cust_LD_text, btnDown_CIRCLE_cust_panel,
  4769.                          btnDown_CIRCLE_use_DP1,
  4770.                          btnDown_CIRCLE_DP1_open_start_delay,
  4771.                          btnDown_CIRCLE_DP1_stay_open_time,
  4772.                          btnDown_CIRCLE_use_DP2,
  4773.                          btnDown_CIRCLE_DP2_open_start_delay,
  4774.                          btnDown_CIRCLE_DP2_stay_open_time,
  4775.                          btnDown_CIRCLE_use_DP3,
  4776.                          btnDown_CIRCLE_DP3_open_start_delay,
  4777.                          btnDown_CIRCLE_DP3_stay_open_time,
  4778.                          btnDown_CIRCLE_use_DP4,
  4779.                          btnDown_CIRCLE_DP4_open_start_delay,
  4780.                          btnDown_CIRCLE_DP4_stay_open_time,
  4781.                          btnDown_CIRCLE_use_DP5,
  4782.                          btnDown_CIRCLE_DP5_open_start_delay,
  4783.                          btnDown_CIRCLE_DP5_stay_open_time,
  4784.                          btnDown_CIRCLE_use_DP6,
  4785.                          btnDown_CIRCLE_DP6_open_start_delay,
  4786.                          btnDown_CIRCLE_DP6_stay_open_time,
  4787.                          btnDown_CIRCLE_use_DP7,
  4788.                          btnDown_CIRCLE_DP7_open_start_delay,
  4789.                          btnDown_CIRCLE_DP7_stay_open_time,
  4790.                          btnDown_CIRCLE_use_DP8,
  4791.                          btnDown_CIRCLE_DP8_open_start_delay,
  4792.                          btnDown_CIRCLE_DP8_stay_open_time,
  4793.                          btnDown_CIRCLE_use_DP9,
  4794.                          btnDown_CIRCLE_DP9_open_start_delay,
  4795.                          btnDown_CIRCLE_DP9_stay_open_time,
  4796.                          btnDown_CIRCLE_use_DP10,
  4797.                          btnDown_CIRCLE_DP10_open_start_delay,
  4798.                          btnDown_CIRCLE_DP10_stay_open_time);
  4799.                    
  4800.         #ifdef SHADOW_VERBOSE      
  4801.              output += "DOME: btnDown_CIRCLE";
  4802.         #endif
  4803.      
  4804.      
  4805.         return;
  4806.        
  4807.     }
  4808.    
  4809.     if (PS3NavDome->getButtonPress(LEFT) && PS3NavFoot->getButtonPress(CIRCLE) && marcDuinoButtonCounter == 1)
  4810.     {
  4811.      
  4812.        marcDuinoButtonPush(1, FTbtnLeft_CIRCLE_MD_func, btnLeft_CIRCLE_cust_MP3_num, btnLeft_CIRCLE_cust_LD_type, btnLeft_CIRCLE_cust_LD_text, btnLeft_CIRCLE_cust_panel,
  4813.                          btnLeft_CIRCLE_use_DP1,
  4814.                          btnLeft_CIRCLE_DP1_open_start_delay,
  4815.                          btnLeft_CIRCLE_DP1_stay_open_time,
  4816.                          btnLeft_CIRCLE_use_DP2,
  4817.                          btnLeft_CIRCLE_DP2_open_start_delay,
  4818.                          btnLeft_CIRCLE_DP2_stay_open_time,
  4819.                          btnLeft_CIRCLE_use_DP3,
  4820.                          btnLeft_CIRCLE_DP3_open_start_delay,
  4821.                          btnLeft_CIRCLE_DP3_stay_open_time,
  4822.                          btnLeft_CIRCLE_use_DP4,
  4823.                          btnLeft_CIRCLE_DP4_open_start_delay,
  4824.                          btnLeft_CIRCLE_DP4_stay_open_time,
  4825.                          btnLeft_CIRCLE_use_DP5,
  4826.                          btnLeft_CIRCLE_DP5_open_start_delay,
  4827.                          btnLeft_CIRCLE_DP5_stay_open_time,
  4828.                          btnLeft_CIRCLE_use_DP6,
  4829.                          btnLeft_CIRCLE_DP6_open_start_delay,
  4830.                          btnLeft_CIRCLE_DP6_stay_open_time,
  4831.                          btnLeft_CIRCLE_use_DP7,
  4832.                          btnLeft_CIRCLE_DP7_open_start_delay,
  4833.                          btnLeft_CIRCLE_DP7_stay_open_time,
  4834.                          btnLeft_CIRCLE_use_DP8,
  4835.                          btnLeft_CIRCLE_DP8_open_start_delay,
  4836.                          btnLeft_CIRCLE_DP8_stay_open_time,
  4837.                          btnLeft_CIRCLE_use_DP9,
  4838.                          btnLeft_CIRCLE_DP9_open_start_delay,
  4839.                          btnLeft_CIRCLE_DP9_stay_open_time,
  4840.                          btnLeft_CIRCLE_use_DP10,
  4841.                          btnLeft_CIRCLE_DP10_open_start_delay,
  4842.                          btnLeft_CIRCLE_DP10_stay_open_time);
  4843.                    
  4844.         #ifdef SHADOW_VERBOSE      
  4845.              output += "DOME: btnLeft_CIRCLE";
  4846.         #endif
  4847.      
  4848.      
  4849.         return;
  4850.        
  4851.     }
  4852.  
  4853.     if (PS3NavDome->getButtonPress(RIGHT) && PS3NavFoot->getButtonPress(CIRCLE) && marcDuinoButtonCounter == 1)
  4854.     {
  4855.      
  4856.        marcDuinoButtonPush(1, FTbtnRight_CIRCLE_MD_func, btnRight_CIRCLE_cust_MP3_num, btnRight_CIRCLE_cust_LD_type, btnRight_CIRCLE_cust_LD_text, btnRight_CIRCLE_cust_panel,
  4857.                          btnRight_CIRCLE_use_DP1,
  4858.                          btnRight_CIRCLE_DP1_open_start_delay,
  4859.                          btnRight_CIRCLE_DP1_stay_open_time,
  4860.                          btnRight_CIRCLE_use_DP2,
  4861.                          btnRight_CIRCLE_DP2_open_start_delay,
  4862.                          btnRight_CIRCLE_DP2_stay_open_time,
  4863.                          btnRight_CIRCLE_use_DP3,
  4864.                          btnRight_CIRCLE_DP3_open_start_delay,
  4865.                          btnRight_CIRCLE_DP3_stay_open_time,
  4866.                          btnRight_CIRCLE_use_DP4,
  4867.                          btnRight_CIRCLE_DP4_open_start_delay,
  4868.                          btnRight_CIRCLE_DP4_stay_open_time,
  4869.                          btnRight_CIRCLE_use_DP5,
  4870.                          btnRight_CIRCLE_DP5_open_start_delay,
  4871.                          btnRight_CIRCLE_DP5_stay_open_time,
  4872.                          btnRight_CIRCLE_use_DP6,
  4873.                          btnRight_CIRCLE_DP6_open_start_delay,
  4874.                          btnRight_CIRCLE_DP6_stay_open_time,
  4875.                          btnRight_CIRCLE_use_DP7,
  4876.                          btnRight_CIRCLE_DP7_open_start_delay,
  4877.                          btnRight_CIRCLE_DP7_stay_open_time,
  4878.                          btnRight_CIRCLE_use_DP8,
  4879.                          btnRight_CIRCLE_DP8_open_start_delay,
  4880.                          btnRight_CIRCLE_DP8_stay_open_time,
  4881.                          btnRight_CIRCLE_use_DP9,
  4882.                          btnRight_CIRCLE_DP9_open_start_delay,
  4883.                          btnRight_CIRCLE_DP9_stay_open_time,
  4884.                          btnRight_CIRCLE_use_DP10,
  4885.                          btnRight_CIRCLE_DP10_open_start_delay,
  4886.                          btnRight_CIRCLE_DP10_stay_open_time);
  4887.            
  4888.        
  4889.         #ifdef SHADOW_VERBOSE      
  4890.              output += "DOME: btnRight_CIRCLE";
  4891.         #endif
  4892.      
  4893.      
  4894.         return;
  4895.        
  4896.     }
  4897.    
  4898.     //------------------------------------
  4899.     // Send triggers for the L1 + base buttons
  4900.     //------------------------------------
  4901.     if (PS3NavDome->getButtonPress(UP) && PS3NavDome->getButtonPress(L1) && marcDuinoButtonCounter == 1)
  4902.     {
  4903.      
  4904.        marcDuinoButtonPush(1, FTbtnUP_L1_MD_func, btnUP_L1_cust_MP3_num, btnUP_L1_cust_LD_type, btnUP_L1_cust_LD_text, btnUP_L1_cust_panel,
  4905.                          btnUP_L1_use_DP1,
  4906.                          btnUP_L1_DP1_open_start_delay,
  4907.                          btnUP_L1_DP1_stay_open_time,
  4908.                          btnUP_L1_use_DP2,
  4909.                          btnUP_L1_DP2_open_start_delay,
  4910.                          btnUP_L1_DP2_stay_open_time,
  4911.                          btnUP_L1_use_DP3,
  4912.                          btnUP_L1_DP3_open_start_delay,
  4913.                          btnUP_L1_DP3_stay_open_time,
  4914.                          btnUP_L1_use_DP4,
  4915.                          btnUP_L1_DP4_open_start_delay,
  4916.                          btnUP_L1_DP4_stay_open_time,
  4917.                          btnUP_L1_use_DP5,
  4918.                          btnUP_L1_DP5_open_start_delay,
  4919.                          btnUP_L1_DP5_stay_open_time,
  4920.                          btnUP_L1_use_DP6,
  4921.                          btnUP_L1_DP6_open_start_delay,
  4922.                          btnUP_L1_DP6_stay_open_time,
  4923.                          btnUP_L1_use_DP7,
  4924.                          btnUP_L1_DP7_open_start_delay,
  4925.                          btnUP_L1_DP7_stay_open_time,
  4926.                          btnUP_L1_use_DP8,
  4927.                          btnUP_L1_DP8_open_start_delay,
  4928.                          btnUP_L1_DP8_stay_open_time,
  4929.                          btnUP_L1_use_DP9,
  4930.                          btnUP_L1_DP9_open_start_delay,
  4931.                          btnUP_L1_DP9_stay_open_time,
  4932.                          btnUP_L1_use_DP10,
  4933.                          btnUP_L1_DP10_open_start_delay,
  4934.                          btnUP_L1_DP10_stay_open_time);
  4935.            
  4936.         #ifdef SHADOW_VERBOSE      
  4937.              output += "DOME: btnUP_L1";
  4938.         #endif
  4939.      
  4940.      
  4941.         return;
  4942.        
  4943.     }
  4944.    
  4945.     if (PS3NavDome->getButtonPress(DOWN) && PS3NavDome->getButtonPress(L1) && marcDuinoButtonCounter == 1)
  4946.     {
  4947.      
  4948.        marcDuinoButtonPush(1, FTbtnDown_L1_MD_func, btnDown_L1_cust_MP3_num, btnDown_L1_cust_LD_type, btnDown_L1_cust_LD_text, btnDown_L1_cust_panel,
  4949.                          btnDown_L1_use_DP1,
  4950.                          btnDown_L1_DP1_open_start_delay,
  4951.                          btnDown_L1_DP1_stay_open_time,
  4952.                          btnDown_L1_use_DP2,
  4953.                          btnDown_L1_DP2_open_start_delay,
  4954.                          btnDown_L1_DP2_stay_open_time,
  4955.                          btnDown_L1_use_DP3,
  4956.                          btnDown_L1_DP3_open_start_delay,
  4957.                          btnDown_L1_DP3_stay_open_time,
  4958.                          btnDown_L1_use_DP4,
  4959.                          btnDown_L1_DP4_open_start_delay,
  4960.                          btnDown_L1_DP4_stay_open_time,
  4961.                          btnDown_L1_use_DP5,
  4962.                          btnDown_L1_DP5_open_start_delay,
  4963.                          btnDown_L1_DP5_stay_open_time,
  4964.                          btnDown_L1_use_DP6,
  4965.                          btnDown_L1_DP6_open_start_delay,
  4966.                          btnDown_L1_DP6_stay_open_time,
  4967.                          btnDown_L1_use_DP7,
  4968.                          btnDown_L1_DP7_open_start_delay,
  4969.                          btnDown_L1_DP7_stay_open_time,
  4970.                          btnDown_L1_use_DP8,
  4971.                          btnDown_L1_DP8_open_start_delay,
  4972.                          btnDown_L1_DP8_stay_open_time,
  4973.                          btnDown_L1_use_DP9,
  4974.                          btnDown_L1_DP9_open_start_delay,
  4975.                          btnDown_L1_DP9_stay_open_time,
  4976.                          btnDown_L1_use_DP10,
  4977.                          btnDown_L1_DP10_open_start_delay,
  4978.                          btnDown_L1_DP10_stay_open_time);
  4979.                    
  4980.         #ifdef SHADOW_VERBOSE      
  4981.              output += "DOME: btnDown_L1";
  4982.         #endif
  4983.      
  4984.      
  4985.         return;
  4986.        
  4987.     }
  4988.    
  4989.     if (PS3NavDome->getButtonPress(LEFT) && PS3NavDome->getButtonPress(L1) && marcDuinoButtonCounter == 1)
  4990.     {
  4991.      
  4992.        marcDuinoButtonPush(1, FTbtnLeft_L1_MD_func, btnLeft_L1_cust_MP3_num, btnLeft_L1_cust_LD_type, btnLeft_L1_cust_LD_text, btnLeft_L1_cust_panel,
  4993.                          btnLeft_L1_use_DP1,
  4994.                          btnLeft_L1_DP1_open_start_delay,
  4995.                          btnLeft_L1_DP1_stay_open_time,
  4996.                          btnLeft_L1_use_DP2,
  4997.                          btnLeft_L1_DP2_open_start_delay,
  4998.                          btnLeft_L1_DP2_stay_open_time,
  4999.                          btnLeft_L1_use_DP3,
  5000.                          btnLeft_L1_DP3_open_start_delay,
  5001.                          btnLeft_L1_DP3_stay_open_time,
  5002.                          btnLeft_L1_use_DP4,
  5003.                          btnLeft_L1_DP4_open_start_delay,
  5004.                          btnLeft_L1_DP4_stay_open_time,
  5005.                          btnLeft_L1_use_DP5,
  5006.                          btnLeft_L1_DP5_open_start_delay,
  5007.                          btnLeft_L1_DP5_stay_open_time,
  5008.                          btnLeft_L1_use_DP6,
  5009.                          btnLeft_L1_DP6_open_start_delay,
  5010.                          btnLeft_L1_DP6_stay_open_time,
  5011.                          btnLeft_L1_use_DP7,
  5012.                          btnLeft_L1_DP7_open_start_delay,
  5013.                          btnLeft_L1_DP7_stay_open_time,
  5014.                          btnLeft_L1_use_DP8,
  5015.                          btnLeft_L1_DP8_open_start_delay,
  5016.                          btnLeft_L1_DP8_stay_open_time,
  5017.                          btnLeft_L1_use_DP9,
  5018.                          btnLeft_L1_DP9_open_start_delay,
  5019.                          btnLeft_L1_DP9_stay_open_time,
  5020.                          btnLeft_L1_use_DP10,
  5021.                          btnLeft_L1_DP10_open_start_delay,
  5022.                          btnLeft_L1_DP10_stay_open_time);
  5023.                    
  5024.         #ifdef SHADOW_VERBOSE      
  5025.              output += "DOME: btnLeft_L1";
  5026.         #endif
  5027.      
  5028.      
  5029.         return;
  5030.        
  5031.     }
  5032.  
  5033.     if (PS3NavDome->getButtonPress(RIGHT) && PS3NavDome->getButtonPress(L1) && marcDuinoButtonCounter == 1)
  5034.     {
  5035.      
  5036.        marcDuinoButtonPush(1, FTbtnRight_L1_MD_func, btnRight_L1_cust_MP3_num, btnRight_L1_cust_LD_type, btnRight_L1_cust_LD_text, btnRight_L1_cust_panel,
  5037.                          btnRight_L1_use_DP1,
  5038.                          btnRight_L1_DP1_open_start_delay,
  5039.                          btnRight_L1_DP1_stay_open_time,
  5040.                          btnRight_L1_use_DP2,
  5041.                          btnRight_L1_DP2_open_start_delay,
  5042.                          btnRight_L1_DP2_stay_open_time,
  5043.                          btnRight_L1_use_DP3,
  5044.                          btnRight_L1_DP3_open_start_delay,
  5045.                          btnRight_L1_DP3_stay_open_time,
  5046.                          btnRight_L1_use_DP4,
  5047.                          btnRight_L1_DP4_open_start_delay,
  5048.                          btnRight_L1_DP4_stay_open_time,
  5049.                          btnRight_L1_use_DP5,
  5050.                          btnRight_L1_DP5_open_start_delay,
  5051.                          btnRight_L1_DP5_stay_open_time,
  5052.                          btnRight_L1_use_DP6,
  5053.                          btnRight_L1_DP6_open_start_delay,
  5054.                          btnRight_L1_DP6_stay_open_time,
  5055.                          btnRight_L1_use_DP7,
  5056.                          btnRight_L1_DP7_open_start_delay,
  5057.                          btnRight_L1_DP7_stay_open_time,
  5058.                          btnRight_L1_use_DP8,
  5059.                          btnRight_L1_DP8_open_start_delay,
  5060.                          btnRight_L1_DP8_stay_open_time,
  5061.                          btnRight_L1_use_DP9,
  5062.                          btnRight_L1_DP9_open_start_delay,
  5063.                          btnRight_L1_DP9_stay_open_time,
  5064.                          btnRight_L1_use_DP10,
  5065.                          btnRight_L1_DP10_open_start_delay,
  5066.                          btnRight_L1_DP10_stay_open_time);
  5067.                    
  5068.         #ifdef SHADOW_VERBOSE      
  5069.              output += "DOME: btnRight_L1";
  5070.         #endif
  5071.      
  5072.      
  5073.         return;
  5074.        
  5075.     }
  5076.    
  5077.     //------------------------------------
  5078.     // Send triggers for the PS + base buttons
  5079.     //------------------------------------
  5080.     if (PS3NavDome->getButtonPress(UP) && PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  5081.     {
  5082.      
  5083.        marcDuinoButtonPush(1, FTbtnUP_PS_MD_func, btnUP_PS_cust_MP3_num, btnUP_PS_cust_LD_type, btnUP_PS_cust_LD_text, btnUP_PS_cust_panel,
  5084.                          btnUP_PS_use_DP1,
  5085.                          btnUP_PS_DP1_open_start_delay,
  5086.                          btnUP_PS_DP1_stay_open_time,
  5087.                          btnUP_PS_use_DP2,
  5088.                          btnUP_PS_DP2_open_start_delay,
  5089.                          btnUP_PS_DP2_stay_open_time,
  5090.                          btnUP_PS_use_DP3,
  5091.                          btnUP_PS_DP3_open_start_delay,
  5092.                          btnUP_PS_DP3_stay_open_time,
  5093.                          btnUP_PS_use_DP4,
  5094.                          btnUP_PS_DP4_open_start_delay,
  5095.                          btnUP_PS_DP4_stay_open_time,
  5096.                          btnUP_PS_use_DP5,
  5097.                          btnUP_PS_DP5_open_start_delay,
  5098.                          btnUP_PS_DP5_stay_open_time,
  5099.                          btnUP_PS_use_DP6,
  5100.                          btnUP_PS_DP6_open_start_delay,
  5101.                          btnUP_PS_DP6_stay_open_time,
  5102.                          btnUP_PS_use_DP7,
  5103.                          btnUP_PS_DP7_open_start_delay,
  5104.                          btnUP_PS_DP7_stay_open_time,
  5105.                          btnUP_PS_use_DP8,
  5106.                          btnUP_PS_DP8_open_start_delay,
  5107.                          btnUP_PS_DP8_stay_open_time,
  5108.                          btnUP_PS_use_DP9,
  5109.                          btnUP_PS_DP9_open_start_delay,
  5110.                          btnUP_PS_DP9_stay_open_time,
  5111.                          btnUP_PS_use_DP10,
  5112.                          btnUP_PS_DP10_open_start_delay,
  5113.                          btnUP_PS_DP10_stay_open_time);
  5114.            
  5115.         #ifdef SHADOW_VERBOSE      
  5116.              output += "DOME: btnUP_PS";
  5117.         #endif
  5118.        
  5119.         return;
  5120.        
  5121.     }
  5122.    
  5123.     if (PS3NavDome->getButtonPress(DOWN) && PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  5124.     {
  5125.      
  5126.        marcDuinoButtonPush(1, FTbtnDown_PS_MD_func, btnDown_PS_cust_MP3_num, btnDown_PS_cust_LD_type, btnDown_PS_cust_LD_text, btnDown_PS_cust_panel,
  5127.                          btnDown_PS_use_DP1,
  5128.                          btnDown_PS_DP1_open_start_delay,
  5129.                          btnDown_PS_DP1_stay_open_time,
  5130.                          btnDown_PS_use_DP2,
  5131.                          btnDown_PS_DP2_open_start_delay,
  5132.                          btnDown_PS_DP2_stay_open_time,
  5133.                          btnDown_PS_use_DP3,
  5134.                          btnDown_PS_DP3_open_start_delay,
  5135.                          btnDown_PS_DP3_stay_open_time,
  5136.                          btnDown_PS_use_DP4,
  5137.                          btnDown_PS_DP4_open_start_delay,
  5138.                          btnDown_PS_DP4_stay_open_time,
  5139.                          btnDown_PS_use_DP5,
  5140.                          btnDown_PS_DP5_open_start_delay,
  5141.                          btnDown_PS_DP5_stay_open_time,
  5142.                          btnDown_PS_use_DP6,
  5143.                          btnDown_PS_DP6_open_start_delay,
  5144.                          btnDown_PS_DP6_stay_open_time,
  5145.                          btnDown_PS_use_DP7,
  5146.                          btnDown_PS_DP7_open_start_delay,
  5147.                          btnDown_PS_DP7_stay_open_time,
  5148.                          btnDown_PS_use_DP8,
  5149.                          btnDown_PS_DP8_open_start_delay,
  5150.                          btnDown_PS_DP8_stay_open_time,
  5151.                          btnDown_PS_use_DP9,
  5152.                          btnDown_PS_DP9_open_start_delay,
  5153.                          btnDown_PS_DP9_stay_open_time,
  5154.                          btnDown_PS_use_DP10,
  5155.                          btnDown_PS_DP10_open_start_delay,
  5156.                          btnDown_PS_DP10_stay_open_time);
  5157.                    
  5158.         #ifdef SHADOW_VERBOSE      
  5159.              output += "DOME: btnDown_PS";
  5160.         #endif
  5161.      
  5162.      
  5163.         return;
  5164.        
  5165.     }
  5166.    
  5167.     if (PS3NavDome->getButtonPress(LEFT) && PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  5168.     {
  5169.      
  5170.        marcDuinoButtonPush(1, FTbtnLeft_PS_MD_func, btnLeft_PS_cust_MP3_num, btnLeft_PS_cust_LD_type, btnLeft_PS_cust_LD_text, btnLeft_PS_cust_panel,
  5171.                          btnLeft_PS_use_DP1,
  5172.                          btnLeft_PS_DP1_open_start_delay,
  5173.                          btnLeft_PS_DP1_stay_open_time,
  5174.                          btnLeft_PS_use_DP2,
  5175.                          btnLeft_PS_DP2_open_start_delay,
  5176.                          btnLeft_PS_DP2_stay_open_time,
  5177.                          btnLeft_PS_use_DP3,
  5178.                          btnLeft_PS_DP3_open_start_delay,
  5179.                          btnLeft_PS_DP3_stay_open_time,
  5180.                          btnLeft_PS_use_DP4,
  5181.                          btnLeft_PS_DP4_open_start_delay,
  5182.                          btnLeft_PS_DP4_stay_open_time,
  5183.                          btnLeft_PS_use_DP5,
  5184.                          btnLeft_PS_DP5_open_start_delay,
  5185.                          btnLeft_PS_DP5_stay_open_time,
  5186.                          btnLeft_PS_use_DP6,
  5187.                          btnLeft_PS_DP6_open_start_delay,
  5188.                          btnLeft_PS_DP6_stay_open_time,
  5189.                          btnLeft_PS_use_DP7,
  5190.                          btnLeft_PS_DP7_open_start_delay,
  5191.                          btnLeft_PS_DP7_stay_open_time,
  5192.                          btnLeft_PS_use_DP8,
  5193.                          btnLeft_PS_DP8_open_start_delay,
  5194.                          btnLeft_PS_DP8_stay_open_time,
  5195.                          btnLeft_PS_use_DP9,
  5196.                          btnLeft_PS_DP9_open_start_delay,
  5197.                          btnLeft_PS_DP9_stay_open_time,
  5198.                          btnLeft_PS_use_DP10,
  5199.                          btnLeft_PS_DP10_open_start_delay,
  5200.                          btnLeft_PS_DP10_stay_open_time);
  5201.            
  5202.         #ifdef SHADOW_VERBOSE      
  5203.              output += "DOME: btnLeft_PS";
  5204.         #endif
  5205.      
  5206.      
  5207.         return;
  5208.        
  5209.     }
  5210.  
  5211.     if (PS3NavDome->getButtonPress(RIGHT) && PS3NavFoot->getButtonPress(PS) && marcDuinoButtonCounter == 1)
  5212.     {
  5213.      
  5214.        marcDuinoButtonPush(1, FTbtnRight_PS_MD_func, btnRight_PS_cust_MP3_num, btnRight_PS_cust_LD_type, btnRight_PS_cust_LD_text, btnRight_PS_cust_panel,
  5215.                          btnRight_PS_use_DP1,
  5216.                          btnRight_PS_DP1_open_start_delay,
  5217.                          btnRight_PS_DP1_stay_open_time,
  5218.                          btnRight_PS_use_DP2,
  5219.                          btnRight_PS_DP2_open_start_delay,
  5220.                          btnRight_PS_DP2_stay_open_time,
  5221.                          btnRight_PS_use_DP3,
  5222.                          btnRight_PS_DP3_open_start_delay,
  5223.                          btnRight_PS_DP3_stay_open_time,
  5224.                          btnRight_PS_use_DP4,
  5225.                          btnRight_PS_DP4_open_start_delay,
  5226.                          btnRight_PS_DP4_stay_open_time,
  5227.                          btnRight_PS_use_DP5,
  5228.                          btnRight_PS_DP5_open_start_delay,
  5229.                          btnRight_PS_DP5_stay_open_time,
  5230.                          btnRight_PS_use_DP6,
  5231.                          btnRight_PS_DP6_open_start_delay,
  5232.                          btnRight_PS_DP6_stay_open_time,
  5233.                          btnRight_PS_use_DP7,
  5234.                          btnRight_PS_DP7_open_start_delay,
  5235.                          btnRight_PS_DP7_stay_open_time,
  5236.                          btnRight_PS_use_DP8,
  5237.                          btnRight_PS_DP8_open_start_delay,
  5238.                          btnRight_PS_DP8_stay_open_time,
  5239.                          btnRight_PS_use_DP9,
  5240.                          btnRight_PS_DP9_open_start_delay,
  5241.                          btnRight_PS_DP9_stay_open_time,
  5242.                          btnRight_PS_use_DP10,
  5243.                          btnRight_PS_DP10_open_start_delay,
  5244.                          btnRight_PS_DP10_stay_open_time);
  5245.                    
  5246.         #ifdef SHADOW_VERBOSE      
  5247.              output += "DOME: btnRight_PS";
  5248.         #endif
  5249.      
  5250.      
  5251.         return;
  5252.        
  5253.     }
  5254.  
  5255. }
  5256.  
  5257.  
  5258. // =======================================================================================
  5259. // This function handles the processing of custom MarcDuino panel routines
  5260. // =======================================================================================
  5261. void custMarcDuinoPanel()
  5262. {
  5263.  
  5264.       // Open & Close Logic: Dome Panel #1
  5265.       if (DP1_Status == 1)
  5266.       {
  5267.        
  5268.          if ((DP1_start + (DP1_s_delay * 1000)) < millis())
  5269.          {
  5270.            
  5271.              Serial1.print(":OP01\r");
  5272.              DP1_Status = 2;
  5273.          }
  5274.        
  5275.       }
  5276.      
  5277.       if (DP1_Status == 2)
  5278.       {
  5279.        
  5280.          if ((DP1_start + ((DP1_s_delay + DP1_o_time) * 1000)) < millis())
  5281.          {
  5282.            
  5283.              Serial1.print(":CL01\r");
  5284.              DP1_Status = 0;
  5285.          }        
  5286.        
  5287.       }
  5288.      
  5289.       // Open & Close Logic: Dome Panel #2
  5290.       if (DP2_Status == 1)
  5291.       {
  5292.        
  5293.          if ((DP2_start + (DP2_s_delay * 1000)) < millis())
  5294.          {
  5295.            
  5296.              Serial1.print(":OP02\r");
  5297.              DP2_Status = 2;
  5298.          }
  5299.        
  5300.       }
  5301.      
  5302.       if (DP2_Status == 2)
  5303.       {
  5304.        
  5305.          if ((DP2_start + ((DP2_s_delay + DP2_o_time) * 1000)) < millis())
  5306.          {
  5307.            
  5308.              Serial1.print(":CL02\r");
  5309.              DP2_Status = 0;
  5310.          }        
  5311.        
  5312.       }
  5313.  
  5314.       // Open & Close Logic: Dome Panel #3
  5315.       if (DP3_Status == 1)
  5316.       {
  5317.        
  5318.          if ((DP3_start + (DP3_s_delay * 1000)) < millis())
  5319.          {
  5320.            
  5321.              Serial1.print(":OP03\r");
  5322.              DP3_Status = 2;
  5323.          }
  5324.        
  5325.       }
  5326.      
  5327.       if (DP3_Status == 2)
  5328.       {
  5329.        
  5330.          if ((DP3_start + ((DP3_s_delay + DP3_o_time) * 1000)) < millis())
  5331.          {
  5332.            
  5333.              Serial1.print(":CL03\r");
  5334.              DP3_Status = 0;
  5335.          }        
  5336.        
  5337.       }
  5338.      
  5339.       // Open & Close Logic: Dome Panel #4
  5340.       if (DP4_Status == 1)
  5341.       {
  5342.        
  5343.          if ((DP4_start + (DP4_s_delay * 1000)) < millis())
  5344.          {
  5345.            
  5346.              Serial1.print(":OP04\r");
  5347.              DP4_Status = 2;
  5348.          }
  5349.        
  5350.       }
  5351.      
  5352.       if (DP4_Status == 2)
  5353.       {
  5354.        
  5355.          if ((DP4_start + ((DP4_s_delay + DP4_o_time) * 1000)) < millis())
  5356.          {
  5357.            
  5358.              Serial1.print(":CL04\r");
  5359.              DP4_Status = 0;
  5360.          }        
  5361.        
  5362.       }
  5363.      
  5364.       // Open & Close Logic: Dome Panel #5
  5365.       if (DP5_Status == 1)
  5366.       {
  5367.        
  5368.          if ((DP5_start + (DP5_s_delay * 1000)) < millis())
  5369.          {
  5370.            
  5371.              Serial1.print(":OP05\r");
  5372.              DP5_Status = 2;
  5373.          }
  5374.        
  5375.       }
  5376.      
  5377.       if (DP5_Status == 2)
  5378.       {
  5379.        
  5380.          if ((DP5_start + ((DP5_s_delay + DP5_o_time) * 1000)) < millis())
  5381.          {
  5382.            
  5383.              Serial1.print(":CL05\r");
  5384.              DP5_Status = 0;
  5385.          }        
  5386.        
  5387.       }
  5388.      
  5389.       // Open & Close Logic: Dome Panel #6
  5390.       if (DP6_Status == 1)
  5391.       {
  5392.        
  5393.          if ((DP6_start + (DP6_s_delay * 1000)) < millis())
  5394.          {
  5395.            
  5396.              Serial1.print(":OP06\r");
  5397.              DP6_Status = 2;
  5398.          }
  5399.        
  5400.       }
  5401.      
  5402.       if (DP6_Status == 2)
  5403.       {
  5404.        
  5405.          if ((DP6_start + ((DP6_s_delay + DP6_o_time) * 1000)) < millis())
  5406.          {
  5407.            
  5408.              Serial1.print(":CL06\r");
  5409.              DP6_Status = 0;
  5410.          }        
  5411.        
  5412.       }
  5413.      
  5414.       // Open & Close Logic: Dome Panel #7
  5415.       if (DP7_Status == 1)
  5416.       {
  5417.        
  5418.          if ((DP7_start + (DP7_s_delay * 1000)) < millis())
  5419.          {
  5420.            
  5421.              Serial1.print(":OP07\r");
  5422.              DP7_Status = 2;
  5423.          }
  5424.        
  5425.       }
  5426.      
  5427.       if (DP7_Status == 2)
  5428.       {
  5429.        
  5430.          if ((DP7_start + ((DP7_s_delay + DP7_o_time) * 1000)) < millis())
  5431.          {
  5432.            
  5433.              Serial1.print(":CL07\r");
  5434.              DP7_Status = 0;
  5435.          }        
  5436.        
  5437.       }
  5438.  
  5439.       // Open & Close Logic: Dome Panel #8
  5440.       if (DP8_Status == 1)
  5441.       {
  5442.        
  5443.          if ((DP8_start + (DP8_s_delay * 1000)) < millis())
  5444.          {
  5445.            
  5446.              Serial1.print(":OP08\r");
  5447.              DP8_Status = 2;
  5448.          }
  5449.        
  5450.       }
  5451.      
  5452.       if (DP8_Status == 2)
  5453.       {
  5454.        
  5455.          if ((DP8_start + ((DP8_s_delay + DP8_o_time) * 1000)) < millis())
  5456.          {
  5457.            
  5458.              Serial1.print(":CL08\r");
  5459.              DP8_Status = 0;
  5460.          }        
  5461.        
  5462.       }
  5463.      
  5464.       // Open & Close Logic: Dome Panel #9
  5465.       if (DP9_Status == 1)
  5466.       {
  5467.        
  5468.          if ((DP9_start + (DP9_s_delay * 1000)) < millis())
  5469.          {
  5470.            
  5471.              Serial1.print(":OP09\r");
  5472.              DP9_Status = 2;
  5473.          }
  5474.        
  5475.       }
  5476.      
  5477.       if (DP9_Status == 2)
  5478.       {
  5479.        
  5480.          if ((DP9_start + ((DP9_s_delay + DP9_o_time) * 1000)) < millis())
  5481.          {
  5482.            
  5483.              Serial1.print(":CL09\r");
  5484.              DP9_Status = 0;
  5485.          }        
  5486.        
  5487.       }
  5488.      
  5489.       // Open & Close Logic: Dome Panel #10
  5490.       if (DP10_Status == 1)
  5491.       {
  5492.        
  5493.          if ((DP10_start + (DP10_s_delay * 1000)) < millis())
  5494.          {
  5495.            
  5496.              Serial1.print(":OP10\r");
  5497.              DP10_Status = 2;
  5498.          }
  5499.        
  5500.       }
  5501.      
  5502.       if (DP10_Status == 2)
  5503.       {
  5504.        
  5505.          if ((DP10_start + ((DP10_s_delay + DP10_o_time) * 1000)) < millis())
  5506.          {
  5507.            
  5508.              Serial1.print(":CL10\r");
  5509.              DP10_Status = 0;
  5510.          }        
  5511.        
  5512.       }
  5513.      
  5514.       // If all the panels have now closed - close out the custom routine
  5515.       if (DP1_Status + DP2_Status + DP3_Status + DP4_Status + DP5_Status + DP6_Status + DP7_Status + DP8_Status + DP9_Status + DP10_Status == 0)
  5516.       {
  5517.        
  5518.           runningCustRoutine = false;
  5519.        
  5520.       }
  5521. }
  5522.  
  5523. // =======================================================================================
  5524. //                             Dome Automation Function
  5525. //
  5526. //    Features toggles 'on' via L2 + CIRCLE.  'off' via L2 + CROSS.  Default is 'off'.
  5527. //
  5528. //    This routines randomly turns the dome motor in both directions.  It assumes the
  5529. //    dome is in the 'home' position when the auto dome feature is toggled on.  From
  5530. //    there it turns the dome in a random direction.  Stops for a random length of
  5531. //    of time.  Then returns the dome to the home position.  This randomly repeats.
  5532. //
  5533. //    It is driven off the user variable - time360DomeTurn.  This records how long
  5534. //    it takes the dome to do a 360 degree turn at the given auto dome speed.  Tweaking
  5535. //    this parameter to be close provides the best results.
  5536. //
  5537. //    Activating the dome controller manually immediately cancels the auto dome feature
  5538. //    or you can toggle the feature off by pressing L2 + CROSS.
  5539. // =======================================================================================
  5540. void autoDome()
  5541. {
  5542.     long rndNum;
  5543.     int domeSpeed;
  5544.    
  5545.     if (domeStatus == 0)  // Dome is currently stopped - prepare for a future turn
  5546.     {
  5547.      
  5548.         if (domeTargetPosition == 0)  // Dome is currently in the home position - prepare to turn away
  5549.         {
  5550.          
  5551.             domeStartTurnTime = millis() + (random(3, 10) * 1000);
  5552.            
  5553.             rndNum = random(5,354);
  5554.            
  5555.             domeTargetPosition = rndNum;  // set the target position to a random degree of a 360 circle - shaving off the first and last 5 degrees
  5556.            
  5557.             if (domeTargetPosition < 180)  // Turn the dome in the positive direction
  5558.             {
  5559.              
  5560.                 domeTurnDirection = 1;
  5561.                
  5562.                 domeStopTurnTime = domeStartTurnTime + ((domeTargetPosition / 360) * time360DomeTurn);
  5563.              
  5564.             } else  // Turn the dome in the negative direction
  5565.             {
  5566.                    
  5567.                 domeTurnDirection = -1;
  5568.                
  5569.                 domeStopTurnTime = domeStartTurnTime + (((360 - domeTargetPosition) / 360) * time360DomeTurn);
  5570.              
  5571.             }
  5572.          
  5573.         } else  // Dome is not in the home position - send it back to home
  5574.         {
  5575.          
  5576.             domeStartTurnTime = millis() + (random(3, 10) * 1000);
  5577.            
  5578.             if (domeTargetPosition < 180)
  5579.             {
  5580.              
  5581.                 domeTurnDirection = -1;
  5582.                
  5583.                 domeStopTurnTime = domeStartTurnTime + ((domeTargetPosition / 360) * time360DomeTurn);
  5584.              
  5585.             } else
  5586.             {
  5587.                    
  5588.                 domeTurnDirection = 1;
  5589.                
  5590.                 domeStopTurnTime = domeStartTurnTime + (((360 - domeTargetPosition) / 360) * time360DomeTurn);
  5591.              
  5592.             }
  5593.            
  5594.             domeTargetPosition = 0;
  5595.          
  5596.         }
  5597.      
  5598.         domeStatus = 1;  // Set dome status to preparing for a future turn
  5599.                
  5600.         #ifdef SHADOW_DEBUG
  5601.           output += "Dome Automation: Initial Turn Set\r\n";
  5602.           output +=  "Current Time: ";
  5603.           output +=  millis();
  5604.           output += "\r\n Next Start Time: ";
  5605.           output += domeStartTurnTime;
  5606.           output += "\r\n";
  5607.           output += "Next Stop Time: ";
  5608.           output += domeStopTurnTime;
  5609.           output += "\r\n";          
  5610.           output += "Dome Target Position: ";
  5611.           output += domeTargetPosition;
  5612.           output += "\r\n";          
  5613.         #endif
  5614.  
  5615.     }
  5616.    
  5617.    
  5618.     if (domeStatus == 1)  // Dome is prepared for a future move - start the turn when ready
  5619.     {
  5620.      
  5621.         if (domeStartTurnTime < millis())
  5622.         {
  5623.          
  5624.              domeStatus = 2;
  5625.              
  5626.              #ifdef SHADOW_DEBUG
  5627.                 output += "Dome Automation: Ready To Start Turn\r\n";
  5628.              #endif
  5629.          
  5630.         }
  5631.     }
  5632.    
  5633.     if (domeStatus == 2) // Dome is now actively turning until it reaches its stop time
  5634.     {
  5635.      
  5636.         if (domeStopTurnTime > millis())
  5637.         {
  5638.          
  5639.               domeSpeed = domeAutoSpeed * domeTurnDirection;
  5640.          
  5641.               SyR->motor(domeSpeed);
  5642.  
  5643.              #ifdef SHADOW_DEBUG
  5644.                 output += "Turning Now!!\r\n";
  5645.              #endif
  5646.          
  5647.          
  5648.         } else  // turn completed - stop the motor
  5649.         {
  5650.               domeStatus = 0;
  5651.               SyR->stop();
  5652.  
  5653.               #ifdef SHADOW_DEBUG
  5654.                  output += "STOP TURN!!\r\n";
  5655.               #endif
  5656.         }
  5657.      
  5658.     }
  5659.  
  5660. }
  5661.  
  5662. // =======================================================================================
  5663. //           Program Utility Functions - Called from various locations
  5664. // =======================================================================================
  5665.  
  5666. // =======================================================================================
  5667. //           PPS3 Controller Device Mgt Functions
  5668. // =======================================================================================
  5669.  
  5670. void onInitPS3NavFoot()
  5671. {
  5672.     String btAddress = getLastConnectedBtMAC();
  5673.     PS3NavFoot->setLedOn(LED1);
  5674.     isPS3NavigatonInitialized = true;
  5675.     badPS3Data = 0;
  5676.  
  5677.     #ifdef SHADOW_DEBUG
  5678.       output += "\r\nBT Address of Last connected Device when FOOT PS3 Connected: ";
  5679.       output += btAddress;
  5680.     #endif
  5681.    
  5682.     if (btAddress == PS3ControllerFootMac || btAddress == PS3ControllerBackupFootMac)
  5683.     {
  5684.        
  5685.           #ifdef SHADOW_DEBUG
  5686.              output += "\r\nWe have our FOOT controller connected. "+String(btAddress)+" \r\n";
  5687.           #endif
  5688.          
  5689.           mainControllerConnected = true;
  5690.           WaitingforReconnect = true;
  5691.          
  5692.     } else
  5693.     {
  5694.      
  5695.         // Prevent connection from anything but the MAIN controllers          
  5696.         #ifdef SHADOW_DEBUG
  5697.               output += "\r\nWe have an invalid controller ("+String(btAddress)+") trying to connect as tha FOOT controller, it will be dropped.\r\n";
  5698.         #endif
  5699.  
  5700.         stopFeet();
  5701.         SyR->stop();
  5702.         isFootMotorStopped = true;
  5703.         footDriveSpeed = 0;
  5704.         PS3NavFoot->setLedOff(LED1);
  5705.         PS3NavFoot->disconnect();
  5706.         printOutput();
  5707.    
  5708.         isPS3NavigatonInitialized = false;
  5709.         mainControllerConnected = false;
  5710.        
  5711.     }
  5712. }
  5713.  
  5714. void onInitPS3NavDome()
  5715. {
  5716.     String btAddress = getLastConnectedBtMAC();
  5717.     PS3NavDome->setLedOn(LED1);
  5718.     isSecondaryPS3NavigatonInitialized = true;
  5719.     badPS3Data = 0;
  5720.    
  5721.     if (btAddress == PS3ControllerDomeMAC || btAddress == PS3ControllerBackupDomeMAC)
  5722.     {
  5723.        
  5724.           #ifdef SHADOW_DEBUG
  5725.              output += "\r\nWe have our DOME controller connected. "+String(btAddress)+" \r\n";
  5726.           #endif
  5727.          
  5728.           domeControllerConnected = true;
  5729.           WaitingforReconnectDome = true;
  5730.          
  5731.     } else
  5732.     {
  5733.      
  5734.         // Prevent connection from anything but the DOME controllers          
  5735.         #ifdef SHADOW_DEBUG
  5736.               output += "\r\nWe have an invalid controller ("+String(btAddress)+") trying to connect as the DOME controller, it will be dropped.\r\n";
  5737.         #endif
  5738.  
  5739.         stopFeet();
  5740.         SyR->stop();
  5741.         isFootMotorStopped = true;
  5742.         footDriveSpeed = 0;
  5743.         PS3NavDome->setLedOff(LED1);
  5744.         PS3NavDome->disconnect();
  5745.         printOutput();
  5746.    
  5747.         isSecondaryPS3NavigatonInitialized = false;
  5748.         domeControllerConnected = false;
  5749.        
  5750.     }
  5751. }
  5752.  
  5753. String getLastConnectedBtMAC()
  5754. {
  5755.     String btAddress = "";
  5756.     for(int8_t i = 5; i > 0; i--)
  5757.     {
  5758.         if (Btd.disc_bdaddr[i]<0x10)
  5759.         {
  5760.             btAddress +="0";
  5761.         }
  5762.         btAddress += String(Btd.disc_bdaddr[i], HEX);
  5763.         btAddress +=(":");
  5764.     }
  5765.     btAddress += String(Btd.disc_bdaddr[0], HEX);
  5766.     btAddress.toUpperCase();
  5767.     return btAddress;
  5768. }
  5769.  
  5770. boolean criticalFaultDetect()
  5771. {
  5772.     if (PS3NavFoot->PS3NavigationConnected || PS3NavFoot->PS3Connected)
  5773.     {
  5774.        
  5775.         currentTime = millis();
  5776.         lastMsgTime = PS3NavFoot->getLastMessageTime();
  5777.         msgLagTime = currentTime - lastMsgTime;            
  5778.        
  5779.         if (WaitingforReconnect)
  5780.         {
  5781.            
  5782.             if (msgLagTime < 200)
  5783.             {
  5784.              
  5785.                 WaitingforReconnect = false;
  5786.            
  5787.             }
  5788.            
  5789.             lastMsgTime = currentTime;
  5790.            
  5791.         }
  5792.        
  5793.         if ( currentTime >= lastMsgTime)
  5794.         {
  5795.               msgLagTime = currentTime - lastMsgTime;
  5796.              
  5797.         } else
  5798.         {
  5799.  
  5800.              msgLagTime = 0;
  5801.         }
  5802.        
  5803.         if (msgLagTime > 300 && !isFootMotorStopped)
  5804.         {
  5805.             #ifdef SHADOW_DEBUG
  5806.               output += "It has been 300ms since we heard from the PS3 Foot Controller\r\n";
  5807.               output += "Shut downing motors, and watching for a new PS3 Foot message\r\n";
  5808.             #endif
  5809.             stopFeet();
  5810.             isFootMotorStopped = true;
  5811.             footDriveSpeed = 0;
  5812.         }
  5813.        
  5814.         if ( msgLagTime > 10000 )
  5815.         {
  5816.             #ifdef SHADOW_DEBUG
  5817.               output += "It has been 10s since we heard from the PS3 Foot Controller\r\n";
  5818.               output += "msgLagTime:";
  5819.               output += msgLagTime;
  5820.               output += "  lastMsgTime:";
  5821.               output += lastMsgTime;
  5822.               output += "  millis:";
  5823.               output += millis();            
  5824.               output += "\r\nDisconnecting the Foot controller.\r\n";
  5825.             #endif
  5826.             stopFeet();
  5827.             isFootMotorStopped = true;
  5828.             footDriveSpeed = 0;
  5829.             PS3NavFoot->disconnect();
  5830.             WaitingforReconnect = true;
  5831.             return true;
  5832.         }
  5833.  
  5834.         //Check PS3 Signal Data
  5835.         if(!PS3NavFoot->getStatus(Plugged) && !PS3NavFoot->getStatus(Unplugged))
  5836.         {
  5837.             //We don't have good data from the controller.
  5838.             //Wait 15ms if no second controller - 100ms if some controller connected, Update USB, and try again
  5839.             if (PS3NavDome->PS3NavigationConnected)
  5840.             {
  5841.                   delay(100);    
  5842.             } else
  5843.             {
  5844.                   delay(15);
  5845.             }
  5846.            
  5847.             Usb.Task();  
  5848.             lastMsgTime = PS3NavFoot->getLastMessageTime();
  5849.            
  5850.             if(!PS3NavFoot->getStatus(Plugged) && !PS3NavFoot->getStatus(Unplugged))
  5851.             {
  5852.                 badPS3Data++;
  5853.                 #ifdef SHADOW_DEBUG
  5854.                     output += "\r\n**Invalid data from PS3 FOOT Controller. - Resetting Data**\r\n";
  5855.                 #endif
  5856.                 return true;
  5857.             }
  5858.         }
  5859.         else if (badPS3Data > 0)
  5860.         {
  5861.  
  5862.             badPS3Data = 0;
  5863.         }
  5864.        
  5865.         if ( badPS3Data > 10 )
  5866.         {
  5867.             #ifdef SHADOW_DEBUG
  5868.                 output += "Too much bad data coming from the PS3 FOOT Controller\r\n";
  5869.                 output += "Disconnecting the controller and stop motors.\r\n";
  5870.             #endif
  5871.             stopFeet();
  5872.             isFootMotorStopped = true;
  5873.             footDriveSpeed = 0;
  5874.             PS3NavFoot->disconnect();
  5875.             WaitingforReconnect = true;
  5876.             return true;
  5877.         }
  5878.     }
  5879.     else if (!isFootMotorStopped) //PS controller is not connected, but foot motors aren't stopped. This is madness!
  5880.     {
  5881.         #ifdef SHADOW_DEBUG      
  5882.             output += "No foot controller was found\r\n";
  5883.             output += "Shuting down motors and watching for a new PS3 foot message\r\n";
  5884.         #endif
  5885.         stopFeet();
  5886.         isFootMotorStopped = true;
  5887.         footDriveSpeed = 0;
  5888.         WaitingforReconnect = true;
  5889.         return true;
  5890.     }
  5891.    
  5892.     return false;
  5893. }
  5894.  
  5895. boolean criticalFaultDetectDome()
  5896. {
  5897.     if (PS3NavDome->PS3NavigationConnected || PS3NavDome->PS3Connected)
  5898.     {
  5899.  
  5900.         currentTime = millis();
  5901.         lastMsgTime = PS3NavDome->getLastMessageTime();
  5902.         msgLagTime = currentTime - lastMsgTime;            
  5903.        
  5904.         if (WaitingforReconnectDome)
  5905.         {
  5906.             if (msgLagTime < 200)
  5907.             {
  5908.              
  5909.                 WaitingforReconnectDome = false;
  5910.            
  5911.             }
  5912.            
  5913.             lastMsgTime = currentTime;
  5914.            
  5915.         }
  5916.        
  5917.         if ( currentTime >= lastMsgTime)
  5918.         {
  5919.              msgLagTime = currentTime - lastMsgTime;
  5920.              
  5921.         } else
  5922.         {
  5923.              msgLagTime = 0;
  5924.         }
  5925.        
  5926.         if ( msgLagTime > 10000 )
  5927.         {
  5928.             #ifdef SHADOW_DEBUG
  5929.               output += "It has been 10s since we heard from the PS3 Dome Controller\r\n";
  5930.               output += "msgLagTime:";
  5931.               output += msgLagTime;
  5932.               output += "  lastMsgTime:";
  5933.               output += lastMsgTime;
  5934.               output += "  millis:";
  5935.               output += millis();            
  5936.               output += "\r\nDisconnecting the Dome controller.\r\n";
  5937.             #endif
  5938.            
  5939.             SyR->stop();
  5940.             PS3NavDome->disconnect();
  5941.             WaitingforReconnectDome = true;
  5942.             return true;
  5943.         }
  5944.  
  5945.         //Check PS3 Signal Data
  5946.         if(!PS3NavDome->getStatus(Plugged) && !PS3NavDome->getStatus(Unplugged))
  5947.         {
  5948.  
  5949.             // We don't have good data from the controller.
  5950.             //Wait 100ms, Update USB, and try again
  5951.             delay(100);
  5952.            
  5953.             Usb.Task();
  5954.             lastMsgTime = PS3NavDome->getLastMessageTime();
  5955.            
  5956.             if(!PS3NavDome->getStatus(Plugged) && !PS3NavDome->getStatus(Unplugged))
  5957.             {
  5958.                 badPS3DataDome++;
  5959.                 #ifdef SHADOW_DEBUG
  5960.                     output += "\r\n**Invalid data from PS3 Dome Controller. - Resetting Data**\r\n";
  5961.                 #endif
  5962.                 return true;
  5963.             }
  5964.         } else if (badPS3DataDome > 0)
  5965.         {
  5966.              badPS3DataDome = 0;
  5967.         }
  5968.        
  5969.         if ( badPS3DataDome > 10 )
  5970.         {
  5971.             #ifdef SHADOW_DEBUG
  5972.                 output += "Too much bad data coming from the PS3 DOME Controller\r\n";
  5973.                 output += "Disconnecting the controller and stop motors.\r\n";
  5974.             #endif
  5975.             SyR->stop();
  5976.             PS3NavDome->disconnect();
  5977.             WaitingforReconnectDome = true;
  5978.             return true;
  5979.         }
  5980.     }
  5981.    
  5982.     return false;
  5983. }
  5984.  
  5985. // =======================================================================================
  5986. //           USB Read Function - Supports Main Program Loop
  5987. // =======================================================================================
  5988.  
  5989. boolean readUSB()
  5990. {
  5991.  
  5992.      Usb.Task();
  5993.      
  5994.     //The more devices we have connected to the USB or BlueTooth, the more often Usb.Task need to be called to eliminate latency.
  5995.     if (PS3NavFoot->PS3NavigationConnected)
  5996.     {
  5997.         if (criticalFaultDetect())
  5998.         {
  5999.             //We have a fault condition that we want to ensure that we do NOT process any controller data!!!
  6000.             printOutput();
  6001.             return false;
  6002.         }
  6003.        
  6004.     } else if (!isFootMotorStopped)
  6005.     {
  6006.         #ifdef SHADOW_DEBUG      
  6007.             output += "No foot controller was found\r\n";
  6008.             output += "Shuting down motors, and watching for a new PS3 foot message\r\n";
  6009.         #endif
  6010.         stopFeet();
  6011.         isFootMotorStopped = true;
  6012.         footDriveSpeed = 0;
  6013.         WaitingforReconnect = true;
  6014.     }
  6015.    
  6016.     if (PS3NavDome->PS3NavigationConnected)
  6017.     {
  6018.  
  6019.         if (criticalFaultDetectDome())
  6020.         {
  6021.            //We have a fault condition that we want to ensure that we do NOT process any controller data!!!
  6022.            printOutput();
  6023.            return false;
  6024.         }
  6025.     }
  6026.    
  6027.     return true;
  6028. }
  6029.  
  6030. // =======================================================================================
  6031. //          Print Output Function
  6032. // =======================================================================================
  6033.  
  6034. void printOutput()
  6035. {
  6036.     if (output != "")
  6037.     {
  6038.         if (Serial) Serial.println(output);
  6039.         output = ""; // Reset output string
  6040.     }
  6041. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement