Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
ashraf_minhaj
Published © GPL3+

Arduino Talk 1: Use Of The Tone Function

Today we'll see how we can add Sound to our project. Using tone Function our project can audio feedback us.

BeginnerFull instructions provided13,419
Arduino Talk 1: Use Of The Tone Function

Things used in this project

Story

Read more

Schematics

Arduinotalk1

Code

ArduinoTalk1.code

C/C++
int buzzer=7; //connecting buzzer to pin 7
void setup()
{
pinMode(buzzer,OUTPUT);  //setting up buzzer pin as output
}
void loop()
{
tone(buzzer,1000,100);  //freq 1000 Hz,delay 100 ms
delay(1000);
tone(buzzer,1000,1000); //freq 1000 Hz,delay 1 sec
delay(100);
}

Credits

ashraf_minhaj
5 projects • 82 followers
Love to kill Soft things with Python and C++, Hard things with Soldering Iron.
Contact

Comments

Please log in or sign up to comment.