Proyek ini menggunakan fungsi tone() Arduino untuk mereplikasi nada dari Lagu Tema Giorno.
Ada banyak bagian di mana not saling tumpang tindih sehingga Arduino kedua digunakan untuk membuat not pada oktaf yang berbeda. Untuk menyinkronkan kedua Arduino, Arduino utama membuat pulsa yang dibawa oleh kabel ke Arduino kedua yang kemudian dimulai secara sinkron.
Kode
- Tema Giorno Bagian 1
- Tema Giorno Bagian 2
Tema Giorno Bagian 1Arduino
Kode ini diupload di Arduino pertama#include "Color.h"int S[] ={ Pink1, 0, Pink1, 0, Pink1, Blue1, 0, Pink1, 0, Orange2, 0, Pink1, 0, Green1 , Biru1, 0, Pink1, 0, Pink1, 0, Pink1, Biru1, 0, Pink1, 0, LHijau2, 0, Kuning2, 0, Orange2, Biru1, 0, Pink1, 0, Pink1, 0, Pink1, Biru1, 0 , Pink1, 0, Orange2, 0, Pink1, 0, Green1, Blue1, 0, Pink1, 0, Pink1, 0, Pink1, Biru1, Pink1, Orange2, 0, LHijau2, 0, Kuning2, 0, Orange2, Biru1, 0 , Pink1, 0, Pink1, 0, Pink1, Biru1, 0, Pink1, 0, Orange2, 0, Pink1, 0, Hijau1, Biru1, 0, Pink1, 0, Pink1, 0, Pink1, Biru1, 0, Pink1, 0 , LGreen2, 0, Yellow2, 0, Orange2, Blue1, 0, Pink1, 0, Pink1, 0, Pink1, Blue1, 0, Pink1, 0, Orange2, 0, Pink1, 0, Hijau1, Biru1, 0, Pink1, 0 , Merah Muda1, 0, Merah Muda1, 0, Biru1, Merah Muda1, 0, 0, 0, 0, Merah Muda1, 0, Oranye2, 0, Kuning2, LHijau2, 0, Hijau2, 0, Biru2, 0, Hijau2, 0, Biru2, Ungu2 , 0, Merah Muda2, 0, Ungu2, 0, Biru2, Hijau2, 0, Kuning2, 0, Oranye2, LBiru1, 0, Biru1, 0, Ungu1, 0, Merah Muda1, 0, Oranye2, 0, Kuning2, LHijau2, 0, Hijau2 , 0, Biru2, 0, Hijau2, 0, Biru2, Ungu2, 0, Pink2, 0, Biru2, Pink2, Biru2, 0, Ungu2, Pink2, 0, LBlue1, 0, LBlue1, Biru1, Biru1, Ungu1, 0, Pink1, 0, Orange2, 0, Kuning2, LHijau2, 0, Hijau2, 0, Biru2, 0, Hijau2, 0, Biru2, Ungu2, 0, Merah Muda2, 0, Ungu2, 0, Biru2, Hijau2, 0, Kuning2, 0, Oranye2, LBiru1, 0, Biru1, 0, Ungu1, 0, Merah Muda1, 0, Oranye2, 0, Kuning2, LHijau2, 0, Hijau2, 0, Biru2, 0, Hijau2, 0, Biru2, Ungu2, 0, Merah Muda2, 0, Biru2, Merah Muda2, Biru2, 0, Ungu2, Merah Muda2, 0, LBiru1, 0, LBiru1, Biru1, Biru1, Ungu1, 0, Oranye2, DOrange2, Merah Muda1, 0, Biru1, 0, 0, Merah Muda1, 0, 0, Merah Muda1, 0, 0, 0, Hijau1, 0, Biru1, 0, Pink1, 0, DOrange2, 0, 0, Biru1, 0, 0, Pink1, 0, 0, 0, 0, 0, Orange2, DOrange2, Pink1, 0, Biru1, 0, 0, Pink1, 0, 0, Pink1, 0, 0, Green1, 0, 0, DOrange2, 0, Orange2, 0, DOrange2, 0, 0, Blue1, 0, DOrange1, Yellow1, Green1, DOrange1, Green1, LBlue1, Pink1, Orange2, DOrange2, Pink1, 0, Blue1, 0, 0, Pink1, 0, 0, Pink1, 0, 0, 0, Green1, 0, Blue1, 0, Pink1, 0, DOrange2, 0, 0, Biru1, 0, 0, Merah Muda1, 0, 0, 0, 0, 0, Orange2, DOrange2, Pink1, 0, Blue1, Orange2, 0, Green2, Yellow2, Orange2, Pink1, 0, Blue2, LBlue2, 0, Green2, Orange2, DOrange2, 0, Pink1, Biru1, Pink1, 0, Biru1, Merah Muda1, 0, Biru1, Merah Muda1, 0, Biru1, Merah Muda1, 0, Biru1, Merah Muda1, Oranye2, 0, Hijau2, 0, 0, 0, 0, 0, Oranye2, 0, 0, 0, 0, 0, 0, Orange2, Yellow2, LGreen2, 0, 0, Yellow2, 0, 0, Orange2, 0, DOrange2, 0, 0, Orange2, 0, 0, Yellow2, 0, Green2, 0, 0, 0, 0, 0, Pink2, 0, 0, 0, 0, 0, Pink1, 0, DOrange2, 0, Orange2, 0, 0, Yellow2, 0, 0, Orange2, 0, DOrange2, 0, 0, Biru2, 0, 0, DGreen2, 0, Green2, 0, 0, 0, 0, 0, Orange2, 0, 0, 0, 0, 0, 0, Orange2, Yellow2, LGreen2, 0, 0, Yellow2, 0, 0, Orange2, 0, DOrange2, 0, 0, Orange2, 0, 0, Yellow2, 0, Green2, 0, 0, 0, 0, 0, Pink2, 0, 0, 0, 0, 0, Green2, 0, Ungu2, 0, Pink2, 0, 0, DGreen2, 0, 0, Green2, 0, LGreen2, 0, 0, Pink2, 0, 0, Green2, 0, Green2};int L =sizeof(S);int nds =10;void setup() { Serial.begin(115200); pinMode(2, OUTPUT); L =L / 2; Serial.println(L); Tone();}void loop() {}void Tone() { digitalWrite(2, HIGH); for (int n =0; n Tema Giorno Bagian 2Arduino
Kode ini diupload di Arduino ke-2#include "Color.h"int S[] ={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , Pink2, 0, Pink2, 0, Pink2, Biru2, 0, Pink2, 0, Orange3, 0, Pink2, 0, Hijau2, Biru2, 0, Pink2, 0, Pink2, 0, Pink2, Biru2, 0, Pink2, 0 , LGreen3, 0, Yellow3, 0, Orange3, Blue2, 0, Pink2, 0, Pink2, 0, Pink2, Biru2, 0, Pink2, 0, Orange3, 0, Pink2, 0, Hijau2, Biru2, 0, Pink2, 0 , Pink2, 0, Pink2, 0, Biru2, Pink2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Orange3, DOrange3, Pink2, 0, Biru 2, 0, 0, Pink2, 0, 0, Pink2, 0, 0, 0, Green2, 0, Blue2, 0, Pink2, 0, DOrange3, 0, 0, Blue2, 0, 0, Pink2, 0, 0, 0, 0, 0, Orange3, DOrange3, Pink2, 0, Blue2, 0, 0, Pink2, 0, 0, Pink2, 0, 0, Green2, 0, 0, DOrange3, 0, Orange3, 0, DOrange3, 0, 0, Biru2, 0, DOrange2, Kuning2, Green2, DOrange2, Green2, LBlue2, Pink2, Orange3, DOrange3, Pink2, 0, Biru2, 0, 0, Pink2, 0, 0, Pink2, 0, 0, 0, Hijau2, 0, Biru2, 0, Pink2, 0, DOrange3, 0, 0, Blue2, 0, 0, Pink2, 0, 0, 0, 0, 0, Orange3, DOrange3, Pink2, 0, Biru2, Orange3, 0, Hijau3, Kuning3, Oranye3, Pink2, 0, Blue3, LBlue3, 0, Green3, Orange3, DOrange3, 0, Pink2, Blue2, Pink2, 0, Blue2, Pink2, 0, Blue2, Pink2, 0, Blue2, Pink2, 0, Blue2, Pink2, Orange3, 0, Green2, 0, 0, 0, 0, 0, Orange2, 0, 0, 0, 0, 0, 0, Orange2, Yellow2, LGreen2, 0, 0, Yellow2, 0, 0, Orange2, 0, DOrange2, 0, 0, Orange2, 0, 0, Yellow2, 0, Green2, 0, 0, 0, 0, 0, Pink2, 0, 0, 0, 0, 0, Pink1, 0, DOrange2, 0, Orange2, 0, 0, Yellow2, 0, 0, Orange2, 0, DOrange2, 0, 0, Blue2, 0, 0, DGreen2, 0, Hijau2, 0, 0, 0, 0, 0, Orange2, 0, 0, 0, 0, 0, 0, Orange2, Yellow2, LGreen2, 0, 0, Yellow2, 0, 0, Orange2, 0, DOrange2, 0, 0, Orange2, 0, 0, Yellow2, 0, Green2, 0, 0, 0, 0, 0, Pink2, 0, 0, 0, 0, 0, Pink2, 0, DOrange3, 0, Orange3, 0, 0, DGreen3, 0, 0, Green3, 0, LGreen3, 0, 0, Orange3, 0, 0, Purple2, 0, Pink2 };int L =sizeof(S);int nds =10;void setup() { Serial .begin(115200); pinMode(3, INPUT_PULLUP); L =L / 2; Serial.println(L);}void loop() { if(!digitalRead(3)) { Nada(); }}void Tone() { for (int n =0; n Skema
speaker_setup_kNNawzl740.fzz