Components and supplies
RBG LED panel
Arduino MP3 Shield
Arduino UNO
Relay Module (Generic)
Plywood
Speaker: 3W, 4 ohms
Tools and machines
Laser cutter (generic)
glass sheet
Project description
Code
Project Repo
Sample Code
arduino
1//Chakra Healing Harmonizer using Arduino 2 3/* 4 5Visit the Channel for more interesting projects 6 7https://www.youtube.com/channel/UCks-9JSnVb22dlqtMgPjrlg 8 9*/ 10#include "SoftwareSerial.h" 11#include <DFPlayer_Mini_Mp3.h> 12 13SoftwareSerial mySerial(11, 10); 14# define Start_Byte 0x7E 15# define Version_Byte 0xFF 16# define Command_Length 0x06 17# define End_Byte 0xEF 18# define Acknowledge 0x00 info] 19 20# define ACTIVATED LOW 21boolean isPlaying = false; 22 23int but = 12; 24int r1= A1, r2 = A2, r3 = A3, r4 = A4, r5 = A5, r6 = A6, r7 = A7; 25 26void setup () { 27pinMode(but, INPUT_PULLUP); 28digitalWrite(but,HIGH); 29 30pinMode(r1, OUTPUT); 31digitalWrite(r1,LOW); 32pinMode(r2, OUTPUT); 33digitalWrite(r2,LOW); 34pinMode(r3, OUTPUT); 35digitalWrite(r3,LOW); 36pinMode(r4, OUTPUT); 37digitalWrite(r4,LOW); 38pinMode(r5, OUTPUT); 39digitalWrite(r5,LOW); 40pinMode(r6, OUTPUT); 41digitalWrite(r6,LOW); 42pinMode(r7, OUTPUT); 43digitalWrite(r7,LOW); 44 45Serial.begin(9600); 46mySerial.begin (9600); 47mp3_set_serial (mySerial); 48mp3_set_volume (25); 49} 50 51void loop () { 52 check_bt(); 53 } 54 55void check_bt() 56{ 57 while (Serial.available()){ 58 delay(10); 59 char c = Serial.read(); 60 if ((c == '~')|| (c == '+')) {break;} 61 voice += c; 62 } 63 if (voice.length() > 0) { 64 Serial.println(voice); 65 66 67 if(voice == "playc1") 68 { 69 voice=""; p1 = 1;relay_1(); 70 mp3_play (1); 71 wait(hr1,minute1,0); 72 mp3_stop (); 73 } 74 else p1 = 0; 75 76 if(voice == "playc2") 77 { 78 voice=""; p2 = 1;relay_2(); 79 mp3_play (2); 80 wait(hr2,minute2,0); 81 mp3_stop (); 82 } 83 else p2 = 0; 84 85 if(voice == "playc3") 86 { 87 voice=""; p3 = 1;relay_3(); 88 mp3_play (3); 89 wait(hr3,minute3,0); 90 mp3_stop (); 91 } 92 else p3 = 0; 93 94 if(voice == "playc4") 95 { 96 voice=""; p4 = 1;relay_4(); 97 mp3_play (4); 98 wait(hr4,minute4,0); 99 mp3_stop (); 100 } 101 else p4 = 0; 102 103 if(voice == "playc5") 104 { 105 voice=""; p5 = 1;relay_5(); 106 mp3_play (5); 107 wait(hr5,minute5,0); 108 mp3_stop (); 109 } 110 else p5 = 0; 111 112 if(voice == "playc6") 113 { 114 voice=""; p6 = 1;relay_6(); 115 mp3_play (6); 116 wait(hr6,minute6,0); 117 mp3_stop (); 118 } 119 else p6 = 0; 120 121 if(voice == "playc7") 122 { 123 voice=""; p7 = 1;relay_7(); 124 mp3_play (7); 125 wait(hr7,minute7,0); 126 mp3_stop (); 127 } 128 else p7 = 0; 129 130////////////////////////////////////////////////////////////////////// 131 132 if(voice == "playal") 133 { 134 voice=""; p_cur = 1; 135 if(p1 == 1) 136 { 137 p1 = 0; relay_1(); 138 mp3_play (1); 139 wait(2,0,0); 140 mp3_stop (); 141 } 142 else if(p2 == 1) 143 { 144 p2 = 0; relay_2(); 145 mp3_play (2); 146 wait(2,0,0); 147 mp3_stop (); 148 } 149 else if(p3 == 1) 150 { 151 p3 = 0; relay_3(); 152 mp3_play (3); 153 wait(2,0,0); 154 mp3_stop (); 155 } 156 else if(p4 == 1) 157 { 158 p4 = 0; relay_4(); 159 mp3_play (4); 160 wait(2,0,0); 161 mp3_stop (); 162 } 163 else if(p5 == 1) 164 { 165 p5 = 0; relay_5(); 166 mp3_play (5); 167 wait(2,0,0); 168 mp3_stop (); 169 } 170 else if(p6 == 1) 171 { 172 p6 = 0; relay_6(); 173 mp3_play (6); 174 wait(2,0,0); 175 mp3_stop (); 176 } 177 else if(p7 == 1) 178 { 179 p7 = 0; relay_7(); 180 mp3_play (7); 181 wait(2,0,0); 182 mp3_stop (); 183 } 184 185 } 186 else p_cur = 0; 187 188///////////////////////////////////////////////////////////////////////////// 189 if(voice == "playrc") 190 { 191 voice=""; p_order = 1; 192 p1 = 1; relay_1(); 193 mp3_play (1); 194 wait(hr1,minute1,0); 195 p1 = 0; 196 mp3_stop (); 197 wait(0,1,0); 198 199 p2 = 1; relay_2(); 200 mp3_play (2); 201 wait(hr2,minute2,0); 202 p2 = 0; 203 mp3_stop (); 204 wait(0,1,0); 205 206 p3 = 1; relay_3(); 207 mp3_play (3); 208 wait(hr3,minute3,0); 209 p3 = 0; 210 mp3_stop (); 211 wait(0,1,0); 212 213 p4 = 1; relay_4(); 214 mp3_play (4); 215 wait(hr4,minute4,0); 216 p4 = 0; 217 mp3_stop (); 218 wait(0,1,0); 219 220 p5 = 1; relay_5(); 221 mp3_play (5); 222 wait(hr5,minute5,0); 223 p5 = 0; 224 mp3_stop (); 225 wait(0,1,0); 226 227 p6 = 1; relay_6(); 228 mp3_play (6); 229 wait(hr6,minute6,0); 230 p6 = 0; 231 mp3_stop (); 232 wait(0,1,0); 233 234 p7 = 1; relay_7(); 235 mp3_play (7); 236 wait(hr7,minute7,0); 237 p7 = 0; 238 mp3_stop (); 239 } 240 else p_order = 0; 241 242 if(voice == "playst") {mp3_stop (); relay_stop(); 243 p1 = 0; p2 = 0; p3 = 0; p4 = 0; p5 = 0; p6 = 0; p7 = 0; 244 p_cur = 0; p_order = 0;} 245 voice="";} 246} 247 248 249void wait(int h,int m,int s) 250{ 251 int t = (h*60*60)+(m*60)+s; 252 for(int i=1;i<t;i++) //1sec 1000ms 253 { 254 for(int j=0;j<40;j++) 255 { 256 delay(25); 257 check_bt(); 258 } 259 } 260} 261 262 263void relay_1() 264{ 265 digitalWrite(r1,HIGH); 266 digitalWrite(r2,LOW); 267 digitalWrite(r3,LOW); 268 digitalWrite(r4,LOW); 269 digitalWrite(r5,LOW); 270 digitalWrite(r6,LOW); 271 digitalWrite(r7,LOW); 272} 273 274void relay_2() 275{ 276 digitalWrite(r1,LOW); 277 digitalWrite(r2,HIGH); 278 digitalWrite(r3,LOW); 279 digitalWrite(r4,LOW); 280 digitalWrite(r5,LOW); 281 digitalWrite(r6,LOW); 282 digitalWrite(r7,LOW); 283} 284 285void relay_3() 286{ 287 digitalWrite(r1,LOW); 288 digitalWrite(r2,LOW); 289 digitalWrite(r3,HIGH); 290 digitalWrite(r4,LOW); 291 digitalWrite(r5,LOW); 292 digitalWrite(r6,LOW); 293 digitalWrite(r7,LOW); 294} 295void relay_4() 296{ 297 digitalWrite(r1,LOW); 298 digitalWrite(r2,LOW); 299 digitalWrite(r3,LOW); 300 digitalWrite(r4,HIGH); 301 digitalWrite(r5,LOW); 302 digitalWrite(r6,LOW); 303 digitalWrite(r7,LOW); 304} 305 306void relay_5() 307{ 308 digitalWrite(r1,LOW); 309 digitalWrite(r2,LOW); 310 digitalWrite(r3,LOW); 311 digitalWrite(r4,LOW); 312 digitalWrite(r5,HIGH); 313 digitalWrite(r6,LOW); 314 digitalWrite(r7,LOW); 315} 316 317void relay_6() 318{ 319 digitalWrite(r1,LOW); 320 digitalWrite(r2,LOW); 321 digitalWrite(r3,LOW); 322 digitalWrite(r4,LOW); 323 digitalWrite(r5,LOW); 324 digitalWrite(r6,HIGH); 325 digitalWrite(r7,LOW); 326} 327 328void relay_7() 329{ 330 digitalWrite(r1,LOW); 331 digitalWrite(r2,LOW); 332 digitalWrite(r3,LOW); 333 digitalWrite(r4,LOW); 334 digitalWrite(r5,LOW); 335 digitalWrite(r6,LOW); 336 digitalWrite(r7,HIGH); 337} 338 339void relay_stop() 340{ 341 digitalWrite(r1,LOW); 342 digitalWrite(r2,LOW); 343 digitalWrite(r3,LOW); 344 digitalWrite(r4,LOW); 345 digitalWrite(r5,LOW); 346 digitalWrite(r6,LOW); 347 digitalWrite(r7,LOW); 348} 349//************************************************************************************************************************************* 350void playFirst() 351{ 352 execute_CMD(0x3F, 0, 0); 353 delay(100); 354 setVolume(25); 355 delay(100); 356 execute_CMD(0x11,0,1); 357 delay(100); 358} 359 360void initiate(){ 361 execute_CMD(0x3F, 0, 0); 362 delay(100); 363 setVolume(25); 364 delay(100);} 365 366void pause() 367{ 368 execute_CMD(0x0E,0,0); 369 delay(100); 370} 371 372void play() 373{ 374 execute_CMD(0x0D,0,1); 375 delay(100); 376} 377 378void playNext() 379{ 380 execute_CMD(0x01,0,1); 381 delay(100); 382} 383 384void playPrevious() 385{ 386 execute_CMD(0x02,0,1); 387 delay(100); 388} 389 390void setVolume(int volume) 391{ 392 execute_CMD(0x06, 0, volume); 393 delay(2000); 394} 395 396void play1() 397{ 398 relay_1(); 399 execute_CMD(0x0D,0,1); 400 delay(100); 401 isPlaying = true; wait(hr1,minute1,0); 402 pause(); 403} 404 405void play2() 406{ 407 p2 = 1; 408 relay_2(); 409 execute_CMD(0x0D,0,2); 410 delay(100); 411 isPlaying = true; wait(hr2,minute2,0); 412 pause(); 413 p2 = 0; 414} 415 416void play3() 417{ 418 p3 = 1; 419 relay_3(); 420 execute_CMD(0x0D,0,3); 421 delay(100); 422 isPlaying = true; wait(hr3,minute3,0); 423 pause(); 424 p3 = 0; 425} 426 427void play4() 428{ 429 p4 = 1; 430 relay_4(); 431 execute_CMD(0x0D,0,4); 432 delay(100); 433 isPlaying = true; wait(hr4,minute4,0); 434 pause(); 435 p4 = 0; 436} 437 438void play5() 439{ 440 p5 = 1; 441 relay_5(); 442 execute_CMD(0x0D,0,5); 443 delay(100); 444 isPlaying = true; wait(hr5,minute5,0); 445 pause(); 446 p5 = 0; 447} 448 449void play6() 450{ 451 p6 = 1; 452 relay_6(); 453 execute_CMD(0x0D,0,6); 454 delay(100); 455 isPlaying = true; wait(hr6,minute6,0); 456 pause(); 457 p6 = 0; 458} 459 460void play7() 461{ 462 p7 = 1; 463 relay_7(); 464 execute_CMD(0x0D,0,7); 465 delay(100); 466 isPlaying = true; wait(hr7,minute7,0); 467 pause(); 468 p7 = 0; 469} 470 471void execute_CMD(byte CMD, byte Par1, byte Par2) 472{ 473word checksum = -(Version_Byte + Command_Length + CMD + Acknowledge + Par1 + Par2); 474byte Command_line[10] = { Start_Byte, Version_Byte, Command_Length, CMD, Acknowledge, 475Par1, Par2, highByte(checksum), lowByte(checksum), End_Byte}; 476for (byte k=0; k<10; k++) 477{ 478mySerial.write( Command_line[k]); 479} 480} 481
Project Repo
Sample Code
arduino
1//Chakra Healing Harmonizer using Arduino 2 3/* 4 5Visit the Channel for more interesting projects 6 7https://www.youtube.com/channel/UCks-9JSnVb22dlqtMgPjrlg 8 9*/ 10#include "SoftwareSerial.h" 11#include <DFPlayer_Mini_Mp3.h> 12 13SoftwareSerial mySerial(11, 10); 14# define Start_Byte 0x7E 15# define Version_Byte 0xFF 16# define Command_Length 0x06 17# define End_Byte 0xEF 18# define Acknowledge 0x00 info] 19 20# define ACTIVATED LOW 21boolean isPlaying = false; 22 23int but = 12; 24int r1= A1, r2 = A2, r3 = A3, r4 = A4, r5 = A5, r6 = A6, r7 = A7; 25 26void setup () { 27pinMode(but, INPUT_PULLUP); 28digitalWrite(but,HIGH); 29 30pinMode(r1, OUTPUT); 31digitalWrite(r1,LOW); 32pinMode(r2, OUTPUT); 33digitalWrite(r2,LOW); 34pinMode(r3, OUTPUT); 35digitalWrite(r3,LOW); 36pinMode(r4, OUTPUT); 37digitalWrite(r4,LOW); 38pinMode(r5, OUTPUT); 39digitalWrite(r5,LOW); 40pinMode(r6, OUTPUT); 41digitalWrite(r6,LOW); 42pinMode(r7, OUTPUT); 43digitalWrite(r7,LOW); 44 45Serial.begin(9600); 46mySerial.begin (9600); 47mp3_set_serial (mySerial); 48mp3_set_volume (25); 49} 50 51void loop () { 52 check_bt(); 53 } 54 55void check_bt() 56{ 57 while (Serial.available()){ 58 delay(10); 59 char c = Serial.read(); 60 if ((c == '~')|| (c == '+')) {break;} 61 voice += c; 62 } 63 if (voice.length() > 0) { 64 Serial.println(voice); 65 66 67 if(voice == "playc1") 68 { 69 voice=""; p1 = 1;relay_1(); 70 mp3_play (1); 71 wait(hr1,minute1,0); 72 mp3_stop (); 73 } 74 else p1 = 0; 75 76 if(voice == "playc2") 77 { 78 voice=""; p2 = 1;relay_2(); 79 mp3_play (2); 80 wait(hr2,minute2,0); 81 mp3_stop (); 82 } 83 else p2 = 0; 84 85 if(voice == "playc3") 86 { 87 voice=""; p3 = 1;relay_3(); 88 mp3_play (3); 89 wait(hr3,minute3,0); 90 mp3_stop (); 91 } 92 else p3 = 0; 93 94 if(voice == "playc4") 95 { 96 voice=""; p4 = 1;relay_4(); 97 mp3_play (4); 98 wait(hr4,minute4,0); 99 mp3_stop (); 100 } 101 else p4 = 0; 102 103 if(voice == "playc5") 104 { 105 voice=""; p5 = 1;relay_5(); 106 mp3_play (5); 107 wait(hr5,minute5,0); 108 mp3_stop (); 109 } 110 else p5 = 0; 111 112 if(voice == "playc6") 113 { 114 voice=""; p6 = 1;relay_6(); 115 mp3_play (6); 116 wait(hr6,minute6,0); 117 mp3_stop (); 118 } 119 else p6 = 0; 120 121 if(voice == "playc7") 122 { 123 voice=""; p7 = 1;relay_7(); 124 mp3_play (7); 125 wait(hr7,minute7,0); 126 mp3_stop (); 127 } 128 else p7 = 0; 129 130////////////////////////////////////////////////////////////////////// 131 132 if(voice == "playal") 133 { 134 voice=""; p_cur = 1; 135 if(p1 == 1) 136 { 137 p1 = 0; relay_1(); 138 mp3_play (1); 139 wait(2,0,0); 140 mp3_stop (); 141 } 142 else if(p2 == 1) 143 { 144 p2 = 0; relay_2(); 145 mp3_play (2); 146 wait(2,0,0); 147 mp3_stop (); 148 } 149 else if(p3 == 1) 150 { 151 p3 = 0; relay_3(); 152 mp3_play (3); 153 wait(2,0,0); 154 mp3_stop (); 155 } 156 else if(p4 == 1) 157 { 158 p4 = 0; relay_4(); 159 mp3_play (4); 160 wait(2,0,0); 161 mp3_stop (); 162 } 163 else if(p5 == 1) 164 { 165 p5 = 0; relay_5(); 166 mp3_play (5); 167 wait(2,0,0); 168 mp3_stop (); 169 } 170 else if(p6 == 1) 171 { 172 p6 = 0; relay_6(); 173 mp3_play (6); 174 wait(2,0,0); 175 mp3_stop (); 176 } 177 else if(p7 == 1) 178 { 179 p7 = 0; relay_7(); 180 mp3_play (7); 181 wait(2,0,0); 182 mp3_stop (); 183 } 184 185 } 186 else p_cur = 0; 187 188///////////////////////////////////////////////////////////////////////////// 189 if(voice == "playrc") 190 { 191 voice=""; p_order = 1; 192 p1 = 1; relay_1(); 193 mp3_play (1); 194 wait(hr1,minute1,0); 195 p1 = 0; 196 mp3_stop (); 197 wait(0,1,0); 198 199 p2 = 1; relay_2(); 200 mp3_play (2); 201 wait(hr2,minute2,0); 202 p2 = 0; 203 mp3_stop (); 204 wait(0,1,0); 205 206 p3 = 1; relay_3(); 207 mp3_play (3); 208 wait(hr3,minute3,0); 209 p3 = 0; 210 mp3_stop (); 211 wait(0,1,0); 212 213 p4 = 1; relay_4(); 214 mp3_play (4); 215 wait(hr4,minute4,0); 216 p4 = 0; 217 mp3_stop (); 218 wait(0,1,0); 219 220 p5 = 1; relay_5(); 221 mp3_play (5); 222 wait(hr5,minute5,0); 223 p5 = 0; 224 mp3_stop (); 225 wait(0,1,0); 226 227 p6 = 1; relay_6(); 228 mp3_play (6); 229 wait(hr6,minute6,0); 230 p6 = 0; 231 mp3_stop (); 232 wait(0,1,0); 233 234 p7 = 1; relay_7(); 235 mp3_play (7); 236 wait(hr7,minute7,0); 237 p7 = 0; 238 mp3_stop (); 239 } 240 else p_order = 0; 241 242 if(voice == "playst") {mp3_stop (); relay_stop(); 243 p1 = 0; p2 = 0; p3 = 0; p4 = 0; p5 = 0; p6 = 0; p7 = 0; 244 p_cur = 0; p_order = 0;} 245 voice="";} 246} 247 248 249void wait(int h,int m,int s) 250{ 251 int t = (h*60*60)+(m*60)+s; 252 for(int i=1;i<t;i++) //1sec 1000ms 253 { 254 for(int j=0;j<40;j++) 255 { 256 delay(25); 257 check_bt(); 258 } 259 } 260} 261 262 263void relay_1() 264{ 265 digitalWrite(r1,HIGH); 266 digitalWrite(r2,LOW); 267 digitalWrite(r3,LOW); 268 digitalWrite(r4,LOW); 269 digitalWrite(r5,LOW); 270 digitalWrite(r6,LOW); 271 digitalWrite(r7,LOW); 272} 273 274void relay_2() 275{ 276 digitalWrite(r1,LOW); 277 digitalWrite(r2,HIGH); 278 digitalWrite(r3,LOW); 279 digitalWrite(r4,LOW); 280 digitalWrite(r5,LOW); 281 digitalWrite(r6,LOW); 282 digitalWrite(r7,LOW); 283} 284 285void relay_3() 286{ 287 digitalWrite(r1,LOW); 288 digitalWrite(r2,LOW); 289 digitalWrite(r3,HIGH); 290 digitalWrite(r4,LOW); 291 digitalWrite(r5,LOW); 292 digitalWrite(r6,LOW); 293 digitalWrite(r7,LOW); 294} 295void relay_4() 296{ 297 digitalWrite(r1,LOW); 298 digitalWrite(r2,LOW); 299 digitalWrite(r3,LOW); 300 digitalWrite(r4,HIGH); 301 digitalWrite(r5,LOW); 302 digitalWrite(r6,LOW); 303 digitalWrite(r7,LOW); 304} 305 306void relay_5() 307{ 308 digitalWrite(r1,LOW); 309 digitalWrite(r2,LOW); 310 digitalWrite(r3,LOW); 311 digitalWrite(r4,LOW); 312 digitalWrite(r5,HIGH); 313 digitalWrite(r6,LOW); 314 digitalWrite(r7,LOW); 315} 316 317void relay_6() 318{ 319 digitalWrite(r1,LOW); 320 digitalWrite(r2,LOW); 321 digitalWrite(r3,LOW); 322 digitalWrite(r4,LOW); 323 digitalWrite(r5,LOW); 324 digitalWrite(r6,HIGH); 325 digitalWrite(r7,LOW); 326} 327 328void relay_7() 329{ 330 digitalWrite(r1,LOW); 331 digitalWrite(r2,LOW); 332 digitalWrite(r3,LOW); 333 digitalWrite(r4,LOW); 334 digitalWrite(r5,LOW); 335 digitalWrite(r6,LOW); 336 digitalWrite(r7,HIGH); 337} 338 339void relay_stop() 340{ 341 digitalWrite(r1,LOW); 342 digitalWrite(r2,LOW); 343 digitalWrite(r3,LOW); 344 digitalWrite(r4,LOW); 345 digitalWrite(r5,LOW); 346 digitalWrite(r6,LOW); 347 digitalWrite(r7,LOW); 348} 349//************************************************************************************************************************************* 350void playFirst() 351{ 352 execute_CMD(0x3F, 0, 0); 353 delay(100); 354 setVolume(25); 355 delay(100); 356 execute_CMD(0x11,0,1); 357 delay(100); 358} 359 360void initiate(){ 361 execute_CMD(0x3F, 0, 0); 362 delay(100); 363 setVolume(25); 364 delay(100);} 365 366void pause() 367{ 368 execute_CMD(0x0E,0,0); 369 delay(100); 370} 371 372void play() 373{ 374 execute_CMD(0x0D,0,1); 375 delay(100); 376} 377 378void playNext() 379{ 380 execute_CMD(0x01,0,1); 381 delay(100); 382} 383 384void playPrevious() 385{ 386 execute_CMD(0x02,0,1); 387 delay(100); 388} 389 390void setVolume(int volume) 391{ 392 execute_CMD(0x06, 0, volume); 393 delay(2000); 394} 395 396void play1() 397{ 398 relay_1(); 399 execute_CMD(0x0D,0,1); 400 delay(100); 401 isPlaying = true; wait(hr1,minute1,0); 402 pause(); 403} 404 405void play2() 406{ 407 p2 = 1; 408 relay_2(); 409 execute_CMD(0x0D,0,2); 410 delay(100); 411 isPlaying = true; wait(hr2,minute2,0); 412 pause(); 413 p2 = 0; 414} 415 416void play3() 417{ 418 p3 = 1; 419 relay_3(); 420 execute_CMD(0x0D,0,3); 421 delay(100); 422 isPlaying = true; wait(hr3,minute3,0); 423 pause(); 424 p3 = 0; 425} 426 427void play4() 428{ 429 p4 = 1; 430 relay_4(); 431 execute_CMD(0x0D,0,4); 432 delay(100); 433 isPlaying = true; wait(hr4,minute4,0); 434 pause(); 435 p4 = 0; 436} 437 438void play5() 439{ 440 p5 = 1; 441 relay_5(); 442 execute_CMD(0x0D,0,5); 443 delay(100); 444 isPlaying = true; wait(hr5,minute5,0); 445 pause(); 446 p5 = 0; 447} 448 449void play6() 450{ 451 p6 = 1; 452 relay_6(); 453 execute_CMD(0x0D,0,6); 454 delay(100); 455 isPlaying = true; wait(hr6,minute6,0); 456 pause(); 457 p6 = 0; 458} 459 460void play7() 461{ 462 p7 = 1; 463 relay_7(); 464 execute_CMD(0x0D,0,7); 465 delay(100); 466 isPlaying = true; wait(hr7,minute7,0); 467 pause(); 468 p7 = 0; 469} 470 471void execute_CMD(byte CMD, byte Par1, byte Par2) 472{ 473word checksum = -(Version_Byte + Command_Length + CMD + Acknowledge + Par1 + Par2); 474byte Command_line[10] = { Start_Byte, Version_Byte, Command_Length, CMD, Acknowledge, 475Par1, Par2, highByte(checksum), lowByte(checksum), End_Byte}; 476for (byte k=0; k<10; k++) 477{ 478mySerial.write( Command_line[k]); 479} 480} 481
Downloadable files
Connection Sample
Connection Sample
Connection Sample
Connection Sample
Connection Sample
Connection Sample
Connection Sample
Connection Sample
Connection Sample
Connection Sample
Comments
Only logged in users can leave comments