littlefalcon9
Published

Sound board

3 buttons to make different noises on elegoo mega 2560.

BeginnerFull instructions provided1,335
Sound board

Things used in this project

Hardware components

Passive buzzer
you need this
×1
button
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
ELEGOO Mega 2560 R3 Board Black ATmega2560 ATMEGA16U2
ELEGOO Mega 2560 R3 Board Black ATmega2560 ATMEGA16U2
×1
ELEGOO Mega 2560 Project The Most Complete Starter Kit
ELEGOO Mega 2560 Project The Most Complete Starter Kit
all these components can be found in this kit
×1

Software apps and online services

Arduino IDE
Arduino IDE
Arduino Web Editor
Arduino Web Editor

Story

Read more

Schematics

untitled3_m7Jannf9Oa.ino

sound_board_Ods9nAtjBg.fzz

sound_board_bb_Onv6jiCT2j.pdf

win_20211229_12_07_01_pro_(2)_fNybDxNxvs.jpg

Code

different_noise_button_pad.ino

C/C++
 
void setup() {
  // put your setup code here, to run once:
pinMode(9,OUTPUT);
pinMode(2,INPUT);
pinMode(3,INPUT);
pinMode(4,INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
if (digitalRead(2) == HIGH)
{
  
  analogWrite(9,200);
  delay(3000);
  analogWrite(9,0);
}

if (digitalRead(3) == HIGH)
{
  analogWrite(9, 130);
    delay(3000);
  analogWrite(9,0);
}


if (digitalRead(4) == HIGH)
{
  analogWrite(9, 25);
    delay(3000);
  analogWrite(9,0);

}
}

Credits

littlefalcon9
2 projects • 2 followers
Contact

Comments

Please log in or sign up to comment.