Khoirul Umam
Published © CC BY

Drum Portable Arduino

Drum Portable berbasis arduino untuk bermain drum yang bisa dibawa kemana mana

BeginnerShowcase (no instructions)2 hours16,930
Drum Portable Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Piezo Sensor
ControlEverything.com Piezo Sensor
×3
modul sdcard reader and writer
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
audio jack out 3.5
×1
Jumper wires (generic)
Jumper wires (generic)
×1
pcb
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Story

Read more

Custom parts and enclosures

dlibary drum sample audio

drum sample sound

Schematics

scematic

Code

drum

C/C++
#include <SimpleSDAudio.h>

void setup() {
  // put your setup code here, to run once:
  SdPlay.setSDCSPin(4);

  if(!SdPlay.init(SSDA_MODE_FULLRATE|SSDA_MODE_STEREO|SSDA_MODE_AUTOWORKER))
  {while(1);}
  // put your setup code here, to run once:
  pinMode(7, INPUT);
  pinMode(8, INPUT);
  pinMode(6, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
  if(digitalRead(8)==HIGH){
    digitalWrite(6, HIGH);
    if(!SdPlay.setFile("snare.wav"))
    {while(0);}

    SdPlay.play();
  }
  else if(digitalRead(2)==HIGH){
    digitalWrite(6, HIGH);
    if(!SdPlay.setFile("kick.wav"))
    {while(0);}

    SdPlay.play();
  }
  else if(digitalRead(3)==HIGH){
    digitalWrite(6, HIGH);
    if(!SdPlay.setFile("crash.wav"))
    {while(0);}

    SdPlay.play();
  }
  else{
    digitalWrite(6, LOW);
  }

}

Credits

Khoirul Umam

Khoirul Umam

1 project • 4 followers

Comments

Add projectSign up / Login