Suga koubou
/
LTC_SMPTE_sample
SMPTE timedode (LTC) decode library for mbed https://developer.mbed.org/users/okini3939/code/LTC_SMPTE/
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "LTC_SMPTE.h" 00003 00004 DigitalOut led1(LED1), led2(LED2); 00005 Serial pc(USBTX, USBRX); 00006 00007 LTC_SMPTE ltc(p21, LTC_SMPTE::LTC_INPUT); // input 00008 //LTC_SMPTE ltc(p22, LTC_SMPTE::LTC_OUTPUT); // output 00009 00010 int main() { 00011 pc.baud(115200); 00012 pc.printf("*** LTC\r\n"); 00013 led1 = 1; 00014 led2 = 0; 00015 00016 // input 00017 while(1) { 00018 if (ltc.isReceived()) { 00019 int hour, min, sec, frame; 00020 ltc.read(&hour, &min, &sec, &frame); 00021 pc.printf("%d %d %d %d\r\n", hour, min, sec, frame); 00022 led2 = !led2; 00023 } 00024 } 00025 /* 00026 // output 00027 ltc.write(0, 0, 0, 0); 00028 while (1) { 00029 int hour, min, sec, frame; 00030 ltc.read(&hour, &min, &sec, &frame); 00031 pc.printf("%d %d %d %d\r\n", hour, min, sec, frame); 00032 led2 = !led2; 00033 wait(1); 00034 } 00035 */ 00036 }
Generated on Sat Jul 30 2022 13:06:28 by 1.7.2