Advertisement
Guest User

Morph Tracer :: Morphed_Plus.ino

a guest
Sep 4th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.84 KB | None | 0 0
  1. __ by__Murdy __ ________
  2. / \ / | / | / |
  3. ██ \ /██ | ______ ______ ______ ██ |____ ████████______ ______ _______ ______ ______
  4. ███ \ /███ |/ \ / \ / \██ \ ██ |/ \/ \ / |/ \ / \
  5. ████ /████ /██████ /██████ /██████ ███████ | ██ /██████ ██████ /███████//██████ /██████ |
  6. ██ ██ ██/██ ██ | ██ ██ | ██/██ | ██ ██ | ██ | ██ ██ | ██// ██ ██ | ██ ██ ██ | ██/
  7. ██ |███/ ██ ██ \__██ ██ | ██ |__██ ██ | ██ | ██ ██ | /███████ ██ \_____████████/██ |
  8. ██ | █/ ██ ██ ██/██ | ██ ██/██ | ██ | ██ ██ | ██ ██ ██ ██ ██ |
  9. ██/ ██/ ██████/ ██/ ███████/ ██/ ██/ ██/██/ ███████/ ███████/ ███████/██/
  10. ``'-.,_,.-'``'-.,_,.='``'-.,_,██ |`'-.
  11. ='``'-.,_,.-'``'-.,_,.='``'-.,██ |'``'-.,(-O-)
  12. ``'-.,_,.-'``'-.,_,.='``'-.,_,██/``'-.,_,.='
  13. ///////////////////////////////////////CREDIT://Mike//Bro//St//////////////////////////////////////////////////////////
  14. //TO INSTALL: //
  15. //**Add this line under // Starting Variables in the NEO.ino file around line 123 //
  16. // volatile int TracerCount; //
  17. // //
  18. //**Replace the MorphNonZero, MorphZero, and PRIME_MORPH sections only in Morphed_Plus.ino with the code below //
  19. //This will affect the Extra2 parameter/value in the Master Builder //
  20. //The value decreases the frequency of how my tracer dots there are, starting with 1(higher for less) (0 off) //
  21. // //
  22. //::Mike Bro St's Rainbow/Candy Tracer:: //
  23. //For color's in the mode use the following on the dim color palette: //
  24. //4,1, 17,0, 30,0, 31,0, 32,0, (Ghost Rainbow Morph) //
  25. //Set the Master Builder prime to://////////////////////////// //
  26. //Prime: 3////ColorTime: 2////BlankTime: 0////E1: 0////E2: 4// //
  27. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  28.  
  29. REPLACE CODE STARTS HERE
  30. I I I
  31. V V V
  32.  
  33. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  34. void MorphNonZero(byte xds)
  35. {// void MorphAfterZero
  36. byte xdata = pgm_read_byte (&MorphingPattern[xds]);
  37. byte yss=0;
  38. while (yss<7 && ToBorNotToB)
  39. {// for yss
  40. if (xdata & (1<<yss))
  41. {
  42. osmPWMtimeless(CCR[VARIATION][color],CCG[VARIATION][color],CCB[VARIATION][color]);
  43. //PrintThis(0,0,1,0);// debug
  44. }
  45. else
  46. {
  47. osmPWMtimeless(CCR[VARIATION][color+1],CCG[VARIATION][color+1],CCB[VARIATION][color+1]);
  48. //PrintThis(0,1,0,0);// debug
  49. }
  50. yss++;
  51. }// rof yss
  52. //PrintThis(0,0,0,1);// debug
  53. }// diov MorphAfterZero
  54. /////////////////////////////////////////////////////////////////////////////////////////////
  55.  
  56.  
  57.  
  58.  
  59. /////////////////////////////////////////////////////////////////////////////////////////////
  60. void MorphZero(byte xds)
  61. {// void MorphAfterZero
  62. byte xdata = pgm_read_byte (&MorphingPattern[xds]);
  63. byte yss=0;
  64. while (yss<7 && ToBorNotToB)
  65. {// for yss
  66. if (xdata & (1<<yss))
  67. {
  68. osmPWMtimeless(CCR[VARIATION][color],CCG[VARIATION][color],CCB[VARIATION][color]);
  69. //PrintThis(0,0,1,0);// debug
  70. }
  71. else
  72. {
  73.  
  74. if (Val2[VARIATION] > 0) {osmPWMtimeless(CCR[VARIATION][1],CCG[VARIATION][1],CCB[VARIATION][1]);}
  75. if (Val2[VARIATION] == 0) {osmPWMtimeless(CCR[VARIATION][0],CCG[VARIATION][0],CCB[VARIATION][0]);}
  76. //PrintThis(0,1,0,0);// debug
  77. }
  78. yss++;
  79. }// rof yss
  80. //PrintThis(0,0,0,1);// debug
  81. }// diov MorphAfterZero
  82. /////////////////////////////////////////////////////////////////////////////////////////////
  83.  
  84.  
  85. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  86.  
  87.  
  88. ///// THIS IS A PRIME
  89. /////////////////////////////////////////////////////////////////////////////////////////////
  90. void PRIME_MORPH(int ColorTime, int BlankTime) //
  91. {// void osm_Morphed
  92.  
  93. int ThisTime;
  94. TracerCount++;
  95. if ( TracerCount > Val2[VARIATION] )
  96. {
  97. osmPWMSCCxyz(CCR[VARIATION][0],CCG[VARIATION][0],CCB[VARIATION][0],CCS[VARIATION][0], 2); //
  98. osmPWMSCCxyz(0,0,0, 0, BlankTime);
  99. TracerCount = 0;
  100. }
  101. if (color == 0 && Val2[VARIATION] > 0 ) {color++;}
  102. ColorTime = ColorTime * 1;
  103. if (color != ColorMaxCount[VARIATION])
  104. {// if
  105. xds=0;
  106. while (xds<9 && ToBorNotToB)
  107. {// while xds
  108. ThisTime = ColorTime;
  109. while (ThisTime > 0 && ToBorNotToB)
  110. { // while ThisTime
  111. MorphNonZero(xds);
  112. ThisTime--;
  113. mmaSensor(PMMAselect, PmmAxis, PAccelSensitivity);
  114. }// while ThisTime
  115. xds++;
  116. osmPWMSCCxyz(0,0,0, 0, BlankTime);
  117. }// elihw xds
  118. }// fi != ColorMaxCount[VARIATION]
  119. else
  120. {// else
  121. xds=0;
  122. while (xds<9 && ToBorNotToB)
  123. {// while xds
  124. ThisTime = ColorTime;
  125. while (ThisTime > 0 && ToBorNotToB)
  126. { // while ThisTime
  127. MorphZero(xds);
  128. ThisTime--;
  129. mmaSensor(PMMAselect, PmmAxis, PAccelSensitivity);
  130. }// while ThisTime
  131. xds++;
  132. osmPWMSCCxyz(0,0,0, 0, BlankTime);
  133. }// elihw xds
  134. }// esle
  135. color++;
  136.  
  137.  
  138. }// diov osm_Morphed
  139. //////////////////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement