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
| #define BUZZER D6 | |
| #define LIGHTD D11 | |
| void setup() { | |
| Serial.begin(115200); | |
| Serial.println("setup"); | |
| pinMode(BUZZER, OUTPUT); | |
| digitalWrite(BUZZER, HIGH); |
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
| //HC-SR04+ | |
| const int trigpin = D4; | |
| const int echopin = D3; | |
| long duration; | |
| int distance; | |
| void setup(){ | |
| pinMode(trigpin,OUTPUT); | |
| pinMode(echopin,INPUT); | |
| Serial.begin(115200); |
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
| # got this from http://stackoverflow.com/questions/8672809/use-ffmpeg-to-add-text-subtitles | |
| ffmpeg -i infile.mp4 -f srt -i infile.srt -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=chi outfile.mp4 | |
| # confirmed working with the following ffmpeg | |
| # (installed using `brew 'ffmpeg', args: ['with-libvorbis', 'with-libvpx']` ) | |
| ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers | |
| built with Apple clang version 12.0.0 (clang-1200.0.32.2) | |
| configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libx |
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 getSystemUUID() -> String? { | |
| let dev = IOServiceMatching("IOPlatformExpertDevice") | |
| let platformExpert: io_service_t = IOServiceGetMatchingService(kIOMasterPortDefault, dev) | |
| let serialNumberAsCFString = IORegistryEntryCreateCFProperty(platformExpert, kIOPlatformUUIDKey as CFString, kCFAllocatorDefault, 0) | |
| IOObjectRelease(platformExpert) | |
| guard let ser: CFTypeRef = serialNumberAsCFString?.takeUnretainedValue() else { return nil } | |
| if let result = ser as? String { | |
| return result |
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
| import Foundation | |
| /** | |
| Set FourCharCode/OSType using a String. | |
| Examples: | |
| let test: FourCharCode = "420v" | |
| let test2 = FourCharCode("420f") | |
| print(test.string, test2.string) | |
| */ |
OlderNewer