This file contains hidden or 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
#include <driver/adc.h> | |
#include <M5Stack.h> | |
const int _bufSize = 128; | |
int _buf[_bufSize]; // adc buffer for suppress speaker noise | |
int _pos = 0; | |
int _old = 0; | |
int _count = 0; | |
int _offset = 0; |
This file contains hidden or 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
func showNotification(title : String, informativeText: String) -> Void { | |
let notification = NSUserNotification() | |
notification.identifier = "\(NSDate().timeIntervalSince1970)" | |
notification.title = title | |
notification.informativeText = informativeText | |
notification.soundName = NSUserNotificationDefaultSoundName | |
NSUserNotificationCenter.default.deliver(notification) | |
} |