Pwm sound (#18)

* just use tone()/noTone() to support PWM sound now

* remove sound_pwm now

* remove sound_pwm
This commit is contained in:
Stephen Crane 2023-07-27 10:50:25 +01:00 committed by GitHub
parent 0ad9cb1741
commit 628a507fe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 28 deletions

View File

@ -17,6 +17,5 @@
#include "timed.h"
#include "hardware.h"
#include "sound_dac.h"
#include "sound_pwm.h"
#endif

View File

@ -1,16 +0,0 @@
#include <Arduino.h>
#include "sound_pwm.h"
static unsigned gpio;
void PWM::begin(unsigned gpio) {
::gpio = gpio;
}
void PWM::stop() {
noTone(gpio);
}
void PWM::start(unsigned freq) {
tone(gpio, freq);
}

View File

@ -1,11 +0,0 @@
#ifndef __SOUND_PWM_H__
#define __SOUND_PWM_H__
class PWM {
public:
void begin(unsigned gpio);
void stop();
void start(unsigned freq);
};
#endif