Bedoel om code uitwisselen

You are viewing an older revision! See the latest version

Darude sandstorm on Arduino

/* Darude - Sandstorm Speaker on port 8

  • /
  1. include "C:\Users\%USERNAME\Documenten\Arduino\Muziek\Muziek.ino"

notes in the melody:

note durations: 4 = quarter note, 8 = eighth note, etc.:

int shortTone = 80; int longTone = 200; int standardDelay = 50; int delayBetweenBars = 50; const int switchPin = 2; int switchstate = 0; int switchstate2 = 0; const int switchPin2 = 3; void setup() { pinMode(switchPin, INPUT); pinMode(switchPin2, INPUT); }

void loop() { switchstate = digitalRead(switchPin); switchstate2 = digitalRead(switchPin2);

if (switchstate == HIGH) { int melody[] = { NOTE_E7, NOTE_E7, 0, NOTE_E7, 0, NOTE_C7, NOTE_E7, 0, NOTE_G7, 0, 0, 0, NOTE_G6, 0, 0, 0,

NOTE_C7, 0, 0, NOTE_G6, 0, 0, NOTE_E6, 0, 0, NOTE_A6, 0, NOTE_B6, 0, NOTE_AS6, NOTE_A6, 0,

NOTE_G6, NOTE_E7, NOTE_G7, NOTE_A7, 0, NOTE_F7, NOTE_G7, 0, NOTE_E7, 0, NOTE_C7, NOTE_D7, NOTE_B6, 0, 0,

NOTE_C7, 0, 0, NOTE_G6, 0, 0, NOTE_E6, 0, 0, NOTE_A6, 0, NOTE_B6, 0, NOTE_AS6, NOTE_A6, 0,

NOTE_G6, NOTE_E7, NOTE_G7, NOTE_A7, 0, NOTE_F7, NOTE_G7, 0, NOTE_E7, 0, NOTE_C7, NOTE_D7, NOTE_B6, 0, 0 }; Mario main them tempo int tempo[] = { 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,

12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,

9, 9, 9, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,

12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,

9, 9, 9, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, }; } }


All wikipages