-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from loelkes/main
Improvements for v2.0.0
- Loading branch information
Showing
19 changed files
with
821 additions
and
697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
BasedOnStyle: Chromium | ||
|
||
... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,41 @@ | ||
#include "Arduino.h" | ||
#include "Config.h" | ||
#include <Arduino.h> | ||
#include "Buzzer.h" | ||
#include "Config.h" | ||
#include "DeviceConfig.h" | ||
|
||
void buzzer_init(){ | ||
pinMode(PIN_BUZZER, OUTPUT); | ||
digitalWrite(PIN_BUZZER, LOW); | ||
void buzzer_init() { | ||
pinMode(PIN_BUZZER, OUTPUT); | ||
digitalWrite(PIN_BUZZER, LOW); | ||
} | ||
|
||
void buzzer_test(){ | ||
buzzer_on(); | ||
void buzzer_test() { | ||
#if DEBUG_LOG > 0 | ||
Serial.print("Buzzer selftest... "); | ||
#endif | ||
analogWrite(PIN_BUZZER, BUZZER_VOLUME); // Buzzer on | ||
delay(1000); | ||
buzzer_off(); | ||
analogWrite(PIN_BUZZER, 0); // Buzzer off | ||
#if DEBUG_LOG > 0 | ||
Serial.println("done!"); | ||
#endif | ||
} | ||
|
||
void buzzer_ack(){ | ||
buzzer_on(); | ||
void buzzer_ack() { | ||
analogWrite(PIN_BUZZER, BUZZER_VOLUME); // Buzzer on | ||
delay(500); | ||
buzzer_off(); | ||
analogWrite(PIN_BUZZER, 0); // Buzzer off | ||
} | ||
|
||
void buzzer_on(){ | ||
analogWrite(PIN_BUZZER, 255/2); //Buzzer an | ||
void buzzer_on() { | ||
device_config_t cfg = config_get_values(); | ||
if (cfg.buzzer_enabled) { | ||
#if DEBUG_LOG > 0 | ||
Serial.println("Buzzer is enabled"); | ||
#endif | ||
analogWrite(PIN_BUZZER, BUZZER_VOLUME); // Buzzer on | ||
} | ||
} | ||
|
||
void buzzer_off(){ | ||
analogWrite(PIN_BUZZER, 0); //Buzzer aus | ||
void buzzer_off() { | ||
analogWrite(PIN_BUZZER, 0); // Buzzer off | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.