Implemented Buzzer

This commit is contained in:
2024-11-22 21:01:23 -05:00
parent a7afcd2551
commit 3e5da27250
4 changed files with 127 additions and 0 deletions

23
main.cpp Normal file
View 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;
}