Mundarija:

Astronomiya tobuti raqsi, Arduino Uno yordamida musiqa: 5 qadam
Astronomiya tobuti raqsi, Arduino Uno yordamida musiqa: 5 qadam

Video: Astronomiya tobuti raqsi, Arduino Uno yordamida musiqa: 5 qadam

Video: Astronomiya tobuti raqsi, Arduino Uno yordamida musiqa: 5 qadam
Video: Инопланетяне Сбили Спутники США 2024, Noyabr
Anonim
Astronomiya tobuti raqslari Arduino Uno yordamida musiqa
Astronomiya tobuti raqslari Arduino Uno yordamida musiqa

Bu blog biz sizga Astronomiya tobuti raqsini Arduino Uno bilan ko'rsatdik

Hammangiz bilasizki, tobut raqsi astronomiyasi haqida memlar yozish

shuning uchun men bu ohangni arduino uno yordamida yaratishga qaror qildim

Mana bu loyihada qo'llaniladigan qadamlar va materiallar va arduino kodlash

1 -qadam: komponentlar

Image
Image

Kerakli komponentlar:

  • Arduino Uno / Nodemcu
  • Jumper simlari
  • Karnay/Buzzer
  • BC547 tranzistor (ixtiyoriy)
  • Led (ixtiyoriy)

2 -qadam: dinamik bilan Arduino ulanishi

Karnay bilan Arduino ulanishi
Karnay bilan Arduino ulanishi

Dinamik bilan Arduino

Bu erda bc547 tranzistorini karnay uchun kuchaytirgich sifatida ishlatganman

3 -qadam: Buzzer bilan Arduino ulanishi

Buzzer bilan Arduino aloqasi
Buzzer bilan Arduino aloqasi
Buzzer bilan Arduino aloqasi
Buzzer bilan Arduino aloqasi

Buzzer bilan Arduino

4 -qadam: Arduino kodi

Tobut raqsi Arduino kodi

Arduino uchun astronomiya kodi quyida keltirilgan.

Quyidagi kodni nusxa ko'chiring va Arduino IDE -ga joylashtiring, so'ngra Arduino taxtasiga yuklang.

#belgilang NOTE_B0 31

#devetine NOTE_C1 33 #devetine NOTE_CS1 35 #devetine NOTE_D1 37 #de NOTINE NOTE_DS1 39 #de NOTINE NOTE_E1 41 #define NOTE_F1 44 #deFIN1 NOTE_FS1 46 #de NOTINE NOTE_G1 49 #deFine NOTE_GS1 52 #deFine NOTEINEEFEEEEE 5511 NOTE_C2 65 #define NOTE_CS2 69 #de NOTINE NOTE_D2 73 #de NOTINE NOTE_DS2 78 #de NOTINE NOTE_E2 82 #deFINE NOTE_F2 87 #deFIN2 NOTE_FS2 93 #deFine NOTE_G2 98 #deFINE NOTE_GS2 104 #devetine NOTE_A2 110 #define2 #define NOTE_CS3 139 #devetine NOTE_D3 147 #define NOTE_DS3 156 #define NOTE_E3 165 #define NOTE_F3 175 #define NOTE_FS3 185 #define NOTE_G3 196 #define NOTE_GS3 208 #efine NOTE_A3 220 #3define23 NOTE_CS4 277 #define NOTE_D4 294 #devetine NOTE_DS4 311 #de NOTINE NOTE_E4 330 #deinine NOTE_F4 349 #define NOTE_FS4 370 #devetine NOTE_G4 392 #define NOTE_GS4 415 #efine NOTE_A4 440 NOT4ine4ine4ine #define NOTE_D5 587 #devetine NOTE_DS5 622 #devetine NOTE_E5 659 #devetine NOTE_F5 698 #deineFineNEWE_FS5 740 #de NOTINE NOTE_G5 784 #devetine NOTE_AGS5 831 #deinine NOTE_A5 880 #define NOTEASINE89A89da NOTE_D6 1175 #define NOTE_DS6 1245 #define NOTE_E6 1319 #define NOTE_F6 1397 #devetine NOTE_FS6 1480 #define NOTE_G6 1568 #devetine NOTE_GS6 1661 #deinine NOTE_A6 1760 #efine NOTE_AS6 1865 NOT7define #define NOTE_DS7 2489 #devetine NOTE_E7 2637 #devetine NOTE_F7 2794 #devetine NOTE_FS7 2960 #deinine NOTE_G7 3136 #de NOTINE NOTE_GS7 3322 #deinine NOTE_A7 3520 #devetine NOTE_AS7 3729 #NOTEFINEEFFINE88_888E88_88DEFE_EFF_478da NOTE_DS8 4978 dyuymli ohang = {NOTE_A4, 0, NOTE_A4, NOTE_A4, NOTE_C5, 0, NOTE_AS4, NOTE_A4, NOTE_G4, 0, NOTE_G4, NOTE_AS5, NOTE_A5, NOTE_AS5, NOTE_A5, NOTE_AS5, NOTE_G4, 0, NOTE_A4, 0, QAYD BILAN 5, NOTE_A5, NOTE_AS5, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4 NOTE_D5, NOTE_D5, NOTE_C5, NOTE_C5, NOTE_C5, NOTE_C5, NOTE_F5, NOTE_F5, NOTE_F5, NOTE_F5, NOTE_G5, NOTE_G5, NOTE_G5, NOTE_G5, NOTE_G5, NOTE_G5, NOTE_G5, NOTE_G5, NOTE_G5 NOTE_F4, NOTE_G4, 0, NOTE_G4, NOTE_D5, NOTE_C5, 0, NOTE_AS4, 0, NOTE_A4, 0, NOTE_A4, NOTE_A4, NOTE_C5, 0, NOTE_AS4, NOTE_A4, NOTE_G4, 0, NOTE_G4, NOTE_AS5, NOTE_A5, NOTE_A5, NOTE_A5, NOTE_A5, NOTE_AS5 NOTE_G4, 0, NOTE_G4, NOTE_AS5, NOTE_A5, NOTE_AS5, NOTE_A5, NOTE_AS5, NOTE_G4, 0, NOTE_G4, NOTE_D5, NOTE_C5, 0, NOTE_AS4, 0, NOTE_A4, 0, NOTE_A4, NOTE_A4, NOTE_A5, NOTE_A4, 0, NOTE_G4, NOTE_AS5, NOTE_A5, NOTE_AS5, NOTE_A5, NOTE_AS5, NOTE_G4, 0, NOTE_G4, NOTE_AS5, NOTE_A5, NOTE_AS5, NOTE_A5, NOTE_AS5; // eslatmalarning davomiyligi: 4 = choraklik eslatma, 8 = sakkizinchi eslatma va boshqalar: int noteDurations = {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,}; void setup () {for (int thisNote = 0; thisNote <112; thisNote ++) {int noteDuration = 750 / noteDurations [thisNote]; ohang (7, ohang [thisNote], noteDuration); int pauseBetweenNotes = noteDuration * 1.30; kechikish (pauseBetweenNotes); noTone (7); }} void loop () {}

Tavsiya: