Play songs, Imperial march and Pirates
Embed:
(wiki syntax)
Show/hide line numbers
play_buzzer.h
Go to the documentation of this file.
00001 /** 00002 * @file play_buzzer.h 00003 * @brief this cpp file is where all the logic is handled. 00004 * 00005 * @author Nikolaj M. & Mathias R. 00006 * 00007 * @date 10/1/2019 00008 */ 00009 00010 //PROGRAM: play_buzzer 00011 #ifndef PLAY_BUZZER_H 00012 #define PLAY_BUZZER_H 00013 00014 #include "mbed.h" 00015 00016 00017 namespace mbed { 00018 ///play_buzzer CLASS 00019 class play_buzzer { 00020 00021 ///INITIALIZE VARIABLES USED IN CLASS 00022 private : 00023 PinName _pin; 00024 PwmOut _pwm; 00025 Timeout toff; 00026 ///FUNCTIONS AND CONSTRUCTOR 00027 public: 00028 play_buzzer(PinName); 00029 void beep (int notes, int tones); 00030 void nobeep(); 00031 int play(int song); 00032 void setPin(PinName pin); 00033 PinName getPin(); 00034 }; 00035 }; 00036 #endif 00037 00038
Generated on Sun Jul 31 2022 20:18:16 by
1.7.2