Pages: [1]   Go Down
Author Topic: Beep Sound  (Read 619 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to make a beep sound with arduino that sounds like the heart monitors at hospitals. I have this code but i dont know what i need to change to make it sound like that.
Code:
int speaker = 4;

void setup() {
  pinMode(speaker, OUTPUT);
}

void loop() {
  for (int i=0; i<30; i++) {
    digitalWrite(speaker, HIGH);
    delayMicroseconds(1000);
    digitalWrite(speaker, LOW);
    delayMicroseconds(1000);
  }
  delay(1800);
}

Here example sound:

THX in advance!
Logged

BCC AZ USA
Offline Offline
Edison Member
*
Karma: 37
Posts: 1294
It gets hot so it must be working
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://forum.arduino.cc/index.php?topic=142097.0;topicseen
Logged

Toledo, OH
Offline Offline
God Member
*****
Karma: 36
Posts: 514
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Frequency of beep, length of beep, and time between beeps.  It's then just a loop.

Tim
Logged

Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

toneAC seems great, i will test it out! thx
Logged

Pages: [1]   Go Up
Jump to: