greenhouse
Macros | Functions | Variables
jukebox.cpp File Reference
#include "jukebox.h"
#include "ThisThread.h"
#include "mbed.h"
Include dependency graph for jukebox.cpp:

Go to the source code of this file.

Macros

#define NOTE_C4   262
 
#define NOTE_D4   294
 
#define NOTE_E4   330
 
#define NOTE_F4   349
 
#define NOTE_G4   392
 
#define NOTE_A4   440
 
#define NOTE_B4   494
 
#define NOTE_C5   523
 
#define NOTE_D5   587
 
#define NOTE_E5   659
 
#define NOTE_F5   698
 
#define NOTE_G5   784
 
#define NOTE_A5   880
 
#define NOTE_B5   988
 

Functions

PwmOut buzzer (D3)
 

Variables

bool isPlaying = false
 
float notes []
 
int duration []
 

Macro Definition Documentation

◆ NOTE_A4

#define NOTE_A4   440

Definition at line 15 of file jukebox.cpp.

◆ NOTE_A5

#define NOTE_A5   880

Definition at line 22 of file jukebox.cpp.

◆ NOTE_B4

#define NOTE_B4   494

Definition at line 16 of file jukebox.cpp.

◆ NOTE_B5

#define NOTE_B5   988

Definition at line 23 of file jukebox.cpp.

◆ NOTE_C4

#define NOTE_C4   262

Definition at line 10 of file jukebox.cpp.

◆ NOTE_C5

#define NOTE_C5   523

Definition at line 17 of file jukebox.cpp.

◆ NOTE_D4

#define NOTE_D4   294

Definition at line 11 of file jukebox.cpp.

◆ NOTE_D5

#define NOTE_D5   587

Definition at line 18 of file jukebox.cpp.

◆ NOTE_E4

#define NOTE_E4   330

Definition at line 12 of file jukebox.cpp.

◆ NOTE_E5

#define NOTE_E5   659

Definition at line 19 of file jukebox.cpp.

◆ NOTE_F4

#define NOTE_F4   349

Definition at line 13 of file jukebox.cpp.

◆ NOTE_F5

#define NOTE_F5   698

Definition at line 20 of file jukebox.cpp.

◆ NOTE_G4

#define NOTE_G4   392

Definition at line 14 of file jukebox.cpp.

◆ NOTE_G5

#define NOTE_G5   784

Definition at line 21 of file jukebox.cpp.

Function Documentation

◆ buzzer()

PwmOut buzzer ( D3  )

Referenced by Jukebox::play(), and Jukebox::stop().

Here is the caller graph for this function:

Variable Documentation

◆ duration

int duration[]

Definition at line 62 of file jukebox.cpp.

Referenced by Jukebox::play().

◆ isPlaying

bool isPlaying = false

Definition at line 8 of file jukebox.cpp.

Referenced by Jukebox::is_playing(), Jukebox::play(), and Jukebox::stop().

◆ notes

float notes[]

Definition at line 25 of file jukebox.cpp.

Referenced by Jukebox::play().