Implemented Buzzer
This commit is contained in:
23
main.cpp
Normal file
23
main.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <iostream>
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#include "Buzzer.hpp"
|
||||
|
||||
int main(int argc, char* args[]) {
|
||||
if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
|
||||
std::cerr << "Couldn't initialize SDL: " << SDL_GetError() << '\n';
|
||||
return 1;
|
||||
}
|
||||
|
||||
Buzzer buzzer(440);
|
||||
buzzer.on();
|
||||
|
||||
SDL_Event event;
|
||||
while(SDL_WaitEvent(&event) && event.type != SDL_QUIT) {
|
||||
}
|
||||
|
||||
buzzer.off();
|
||||
SDL_Quit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user