CQエレクトロニクス・セミナ「実習・マイコンを動かしながら学ぶディジタル・フィルタ」で使うプログラムを,入力として STM32F746 の内蔵 ADC を使うように変更したもの. http://seminar.cqpub.co.jp/ccm/ES18-0020

Dependencies:   mbed Array_Matrix BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Trigger.hpp Source File

Trigger.hpp

00001 //---------------------------------------------------------------
00002 //  トリガの条件を満足する点を探す
00003 //
00004 //  2017/07/24, Copyright (c) 2017 MIKAMI, Naoki
00005 //---------------------------------------------------------------
00006 
00007 #ifndef F746_TRIGGER_HPP
00008 #define F746_TRIGGER_HPP
00009 
00010 #include "mbed.h"
00011 #include "Array.hpp"
00012 
00013 namespace Mikami
00014 {
00015     int Trigger(const Array<int16_t>& xn,   // 対象とするデータ
00016                 int th)                     // トリガの基準値
00017     {
00018         int n;
00019         for (n=1; n<xn.Length()/2; n++)
00020             if ((xn[n-1] < -th) && (xn[n] > th))
00021                 return n;
00022         return 0;
00023     }
00024 }
00025 #endif  // F746_TRIGGER_HPP