Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.88 KB | None | 0 0
  1. long randNumber;
  2. void setup() {
  3. DDRB = B11111111;
  4. DDRD = B11111100;
  5. }
  6. void loop()
  7. {
  8. for(int fadeValue = 0; fadeValue <= 255; fadeValue +=5) {
  9. analogWrite(11, fadeValue);
  10. delay(30);
  11. }
  12. {
  13. for(int fadeValue = 0; fadeValue <= 255; fadeValue +=5) {
  14. analogWrite(9, fadeValue);
  15. delay(30);
  16. } {
  17. for(int fadeValue = 0; fadeValue <= 255; fadeValue +=5) {
  18. analogWrite(10, fadeValue);
  19. delay(30);
  20. } {
  21. for(int fadeValue = 0; fadeValue <= 255; fadeValue +=5) {
  22. analogWrite(6, fadeValue);
  23. delay(30);
  24. } {
  25. for(int fadeValue = 0; fadeValue <= 255; fadeValue +=5) {
  26. analogWrite(5, fadeValue);
  27. delay(30);
  28. }
  29. for(int i = 0; i < 10; i++) {
  30. digitalWrite(12, HIGH);
  31. delay(10);
  32. digitalWrite(12, LOW);
  33. delay(20);
  34. digitalWrite(2, HIGH);
  35. delay(10);
  36. digitalWrite(2, LOW);
  37. }
  38. {
  39. for(int fadeValue = 255; fadeValue >= 0; fadeValue -=5) {
  40. analogWrite(11, fadeValue);
  41. delay(30);
  42. }
  43. {
  44. for(int fadeValue = 255; fadeValue >= 0; fadeValue -=5) {
  45. analogWrite(9, fadeValue);
  46. delay(30);
  47. } {
  48. for(int fadeValue = 255; fadeValue >= 0; fadeValue -=5) {
  49. analogWrite(10, fadeValue);
  50. delay(30);
  51. } {
  52. for(int fadeValue = 255; fadeValue >= 0; fadeValue -=5) {
  53. analogWrite(6, fadeValue);
  54. delay(30);
  55. } {
  56. for(int fadeValue = 255; fadeValue >= 0; fadeValue -=5) {
  57. analogWrite(5, fadeValue);
  58. delay(30);
  59. }
  60. }
  61. {
  62. for(int e = 0; e < 10; e++) {
  63. digitalWrite(12, HIGH);
  64. delay(10);
  65. digitalWrite(12, LOW);
  66. delay(20);
  67. digitalWrite(2, HIGH);
  68. delay(10);
  69. digitalWrite(2, LOW);
  70. }
  71. for(int f = 0; f < 10; f++) {
  72. digitalWrite(7, HIGH);
  73. delay(10);
  74. digitalWrite(7, LOW);
  75. delay(20);
  76. digitalWrite(4, HIGH);
  77. delay(10);
  78. digitalWrite(4, LOW);
  79. }
  80. for(int k = 0; k < 30; k++) {
  81. PORTD= B11111100;
  82. PORTB= B11111110;
  83. delay(10);
  84. PORTD= B00000000;
  85. PORTB= B00000000;
  86. delay(20);
  87. PORTD= B01101100;
  88. PORTB= B10110100;
  89. delay(10);
  90. PORTD= B00000000;
  91. PORTB= B00000000;
  92. }
  93. for(int d = 0; d < 30; d++) {
  94. PORTD= B11111100;
  95. PORTB= B11111100;
  96. delay(40);
  97. PORTD= B00000000;
  98. PORTB= B00000000;
  99. delay(60);
  100. PORTD= B01101100;
  101. PORTB= B10001011;
  102. delay(40);
  103. PORTD= B00000000;
  104. PORTB= B00000000;
  105. }
  106. for(int w = 0; w < 30; w++) {
  107. PORTD= B11111100;
  108. PORTB= B11111100;
  109. delay(60);
  110. PORTD= B00000000;
  111. PORTB= B00000000;
  112. delay(100);
  113. PORTD= B01101100;
  114. PORTB= B10001011;
  115. delay(60);
  116. PORTD= B00000000;
  117. PORTB= B00000000;
  118. }
  119. PORTD= B00000000;
  120. PORTB= B00000000;
  121. delay(3000);
  122. digitalWrite(12, HIGH);
  123. delay(1000);
  124. digitalWrite(2, HIGH);
  125. delay(1000);
  126. digitalWrite(10, HIGH);
  127. delay(1000);
  128. digitalWrite(6, HIGH);
  129. delay(1000);
  130. digitalWrite(9, HIGH);
  131. delay(1000);
  132. digitalWrite(5, HIGH);
  133. delay(1000);
  134. digitalWrite(11, HIGH);
  135. delay(4000);
  136. for(int fadeValue = 255; fadeValue >= 0; fadeValue -=5) {
  137. analogWrite(11, fadeValue);
  138. delay(10);
  139. }
  140. {
  141. for(int fadeValue = 255; fadeValue >= 0; fadeValue -=5) {
  142. analogWrite(9, fadeValue);
  143. delay(10);
  144. } {
  145. for(int fadeValue = 255; fadeValue >= 0; fadeValue -=5) {
  146. analogWrite(10, fadeValue);
  147. delay(10);
  148. } {
  149. for(int fadeValue = 255; fadeValue >= 0; fadeValue -=5) {
  150. analogWrite(6, fadeValue);
  151. delay(10);
  152. } {
  153. for(int fadeValue = 255; fadeValue >= 0; fadeValue -=5) {
  154. analogWrite(5, fadeValue);
  155. delay(10);
  156. }
  157. delay(300);
  158. PORTD= B00000000;
  159. PORTB= B00000000;
  160. delay(400);
  161. for(int f = 0; f < 4; f++) {
  162. digitalWrite(7, HIGH);
  163. delay(500);
  164. digitalWrite(7, LOW);
  165. delay(500);
  166. digitalWrite(4, HIGH);
  167. delay(500);
  168. digitalWrite(4, LOW);
  169. delay(500);
  170. }
  171. for(int f = 0; f < 2; f++) {
  172. digitalWrite(12, HIGH);
  173. delay(500);
  174. digitalWrite(2, HIGH);
  175. delay(500);
  176. digitalWrite(10, HIGH);
  177. delay(500);
  178. digitalWrite(10, LOW);
  179. delay(500);
  180. digitalWrite(2, LOW);
  181. delay(500);
  182. digitalWrite(12, LOW);
  183. delay(500);
  184. }
  185. {
  186. for(int e = 0; e < 20; e++) {
  187. randNumber = random(2, 13);
  188. digitalWrite(randNumber, HIGH);
  189. delay(200);
  190. }
  191. {
  192.  
  193. for(int e = 0; e < 20; e++) {
  194. randNumber = random(2, 13);
  195. digitalWrite(randNumber, LOW);
  196. delay(200);
  197. }
  198. PORTD= B00000000;
  199. PORTB= B00000000;
  200. delay(1500);
  201.  
  202. for(int f = 0; f < 5; f++) {
  203. digitalWrite(10, HIGH);
  204. delay(100);
  205. digitalWrite(2, HIGH);
  206. delay(100);
  207. digitalWrite(6, HIGH);
  208. digitalWrite(9, HIGH);
  209. delay(100);
  210. digitalWrite(7, HIGH);
  211. digitalWrite(4, HIGH);
  212. delay(100);
  213. digitalWrite(5, HIGH);
  214. digitalWrite(11, HIGH);
  215. digitalWrite(12, HIGH);
  216. delay(100);
  217. digitalWrite(10, LOW);
  218. delay(100);
  219. digitalWrite(2, LOW);
  220. delay(100);
  221. digitalWrite(6, LOW);
  222. digitalWrite(9, LOW);
  223. delay(100);
  224. digitalWrite(7, LOW);
  225. digitalWrite(4, LOW);
  226. delay(100);
  227. digitalWrite(5, LOW);
  228. digitalWrite(11, LOW);
  229. digitalWrite(12, LOW);
  230. delay(100);
  231.  
  232. }
  233.  
  234. for(int f = 0; f < 5; f++) {
  235. digitalWrite(5, HIGH);
  236. digitalWrite(11, HIGH);
  237. digitalWrite(12, HIGH);
  238. delay(100);
  239. digitalWrite(7, HIGH);
  240. digitalWrite(4, HIGH);
  241. delay(100);
  242. digitalWrite(6, HIGH);
  243. digitalWrite(9, HIGH);
  244. delay(100);
  245. digitalWrite(2, HIGH);
  246. delay(100);
  247. digitalWrite(10, HIGH);
  248. delay(100);
  249. digitalWrite(5, LOW);
  250. digitalWrite(11, LOW);
  251. digitalWrite(12, LOW);
  252. delay(100);
  253. digitalWrite(7, LOW);
  254. digitalWrite(4, LOW);
  255. delay(100);
  256. digitalWrite(6, LOW);
  257. digitalWrite(9, LOW);
  258. delay(100);
  259. digitalWrite(2, LOW);
  260. delay(100);
  261. digitalWrite(10, LOW);
  262. delay(100);
  263. }
  264. delay(200);
  265.  
  266. }
  267. }
  268. }
  269. }
  270. }
  271. }
  272. }
  273. }
  274. }
  275. }
  276. }
  277. }
  278. }
  279. }
  280. }
  281. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement