Waveform display for input signal using SAI from MEMS microphone or line. MEMS マイクまたはラインから SAI により入力した信号の波形を表示する.
Dependencies: BSP_DISCO_F746NG F746_GUI F746_SAI_IO LCD_DISCO_F746NG TS_DISCO_F746NG mbed
Diff: main.cpp
- Revision:
- 2:afff5ec35233
- Parent:
- 1:04ea670bd41e
- Child:
- 3:b16250c9593c
--- a/main.cpp Mon Aug 15 06:41:59 2016 +0000 +++ b/main.cpp Mon Jan 16 02:55:16 2017 +0000 @@ -2,7 +2,9 @@ // MEMS マイクまたはラインから CODEC を使って入力した信号の波形の表示 // 標本化周波数: 16 kHz // -// 2016/08/15, Copyright (c) 2016 MIKAMI, Naoki +// mbed ライブラリはリビジョン 131 またはそれ以前のものを使うこと +// +// 2017/01/15, Copyright (c) 2017 MIKAMI, Naoki //-------------------------------------------------------------- #include "F746_GUI.hpp" @@ -16,17 +18,17 @@ const uint32_t AXIS_COLOR = 0xFFCCFFFF; const uint32_t LINE_COLOR = LCD_COLOR_CYAN; - const uint32_t N_DATA_SAI = 600; // SAI で使うデータ数 - const uint32_t N_DATA = 400; // 表示するデータ数 + const uint32_t N_DATA_SAI = 600; // SAI で使うデータ数 + const uint32_t N_DATA = N_DATA_SAI*2/3; // 表示するデータ数 SaiIO mySai(SaiIO::INPUT, N_DATA_SAI, I2S_AUDIOFREQ_16K, INPUT_DEVICE_DIGITAL_MICROPHONE_2); - + LCD_DISCO_F746NG *lcd = GuiBase::GetLcdPtr(); lcd->Clear(BACK_COLOR); - Label labelTitle(240, 10, "Simplified Oscilloscope", + Label labelTitle(240, 10, "Simplified Oscilloscope 21:40", Label::CENTER, Font16); - Label labelTrigg(20, 250, ""); + Label labelTrigg(20, 250); const uint16_t B_LEFT = 240; const uint16_t B_TOP = 235; @@ -70,7 +72,7 @@ int swNow; if (inputSw.GetTouchedNumber(swNow) && (swNow != inSelect)) { - mySai.SwitchInputDevice(swNow); // 入力デバイスの設置 + mySai.SwitchInputDevice(swNow); // 入力デバイスの設定 inSelect = swNow; } @@ -80,10 +82,10 @@ mySai.Input(snL[n], snR[n]); bool trigg = myTrigger.Execute(); // トリガと同等の操作 - + if (trigg) labelTrigg.Draw("Triggered"); else labelTrigg.Draw("Not Triggered"); - + waveDispL.Execute(); // 左チャンネルの波形表示 waveDispR.Execute(); // 右チャンネルの波形表示