![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
CQエレクトロニクス・セミナ「実習・マイコンを動かしながら学ぶディジタル・フィルタ」で使うプログラム.1次IIRフィルタの係数をターミナルから変更できる. http://seminar.cqpub.co.jp/ccm/ES18-0020
Dependencies: mbed Array_Matrix BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG
F746_Gui_New/ResetButton.hpp@2:aa11055138a2, 2017-11-08 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Wed Nov 08 11:10:56 2017 +0000
- Revision:
- 2:aa11055138a2
- Parent:
- 0:47718d3154d9
3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 0:47718d3154d9 | 1 | //----------------------------------------------------------- |
MikamiUitOpen | 0:47718d3154d9 | 2 | // ResetButton class -- derived class of Button class |
MikamiUitOpen | 0:47718d3154d9 | 3 | // |
MikamiUitOpen | 0:47718d3154d9 | 4 | // 2017/01/16, Copyright (c) 2017 MIKAMI, Naoki |
MikamiUitOpen | 0:47718d3154d9 | 5 | //----------------------------------------------------------- |
MikamiUitOpen | 0:47718d3154d9 | 6 | |
MikamiUitOpen | 0:47718d3154d9 | 7 | #ifndef F746_RESET_BUTTON_HPP |
MikamiUitOpen | 0:47718d3154d9 | 8 | #define F746_RESET_BUTTON_HPP |
MikamiUitOpen | 0:47718d3154d9 | 9 | |
MikamiUitOpen | 0:47718d3154d9 | 10 | #include "Button.hpp" |
MikamiUitOpen | 0:47718d3154d9 | 11 | |
MikamiUitOpen | 0:47718d3154d9 | 12 | namespace Mikami |
MikamiUitOpen | 0:47718d3154d9 | 13 | { |
MikamiUitOpen | 0:47718d3154d9 | 14 | class ResetButton : public Button |
MikamiUitOpen | 0:47718d3154d9 | 15 | { |
MikamiUitOpen | 0:47718d3154d9 | 16 | public: |
MikamiUitOpen | 0:47718d3154d9 | 17 | ResetButton(uint16_t x = 0, uint16_t y = 240, |
MikamiUitOpen | 0:47718d3154d9 | 18 | uint16_t w = 32, uint16_t h = 32) |
MikamiUitOpen | 0:47718d3154d9 | 19 | : Button(x, y, w, h) |
MikamiUitOpen | 0:47718d3154d9 | 20 | { |
MikamiUitOpen | 0:47718d3154d9 | 21 | pt_[0] = (Point){x+0.2f*w, y+h/2}; |
MikamiUitOpen | 0:47718d3154d9 | 22 | pt_[1] = (Point){x+0.75f*w, y+0.175f*h}; |
MikamiUitOpen | 0:47718d3154d9 | 23 | pt_[2] = (Point){x+0.75f*w, y+0.825f*h}; |
MikamiUitOpen | 0:47718d3154d9 | 24 | Draw(); |
MikamiUitOpen | 0:47718d3154d9 | 25 | } |
MikamiUitOpen | 0:47718d3154d9 | 26 | |
MikamiUitOpen | 0:47718d3154d9 | 27 | void DoIfTouched() |
MikamiUitOpen | 0:47718d3154d9 | 28 | { |
MikamiUitOpen | 0:47718d3154d9 | 29 | if (!Touched()) return; |
MikamiUitOpen | 0:47718d3154d9 | 30 | |
MikamiUitOpen | 0:47718d3154d9 | 31 | wait(0.2f); |
MikamiUitOpen | 0:47718d3154d9 | 32 | NVIC_SystemReset(); |
MikamiUitOpen | 0:47718d3154d9 | 33 | } |
MikamiUitOpen | 0:47718d3154d9 | 34 | |
MikamiUitOpen | 0:47718d3154d9 | 35 | void Draw() |
MikamiUitOpen | 0:47718d3154d9 | 36 | { |
MikamiUitOpen | 0:47718d3154d9 | 37 | Activate(); |
MikamiUitOpen | 0:47718d3154d9 | 38 | lcd_.SetTextColor(LCD_COLOR_WHITE); |
MikamiUitOpen | 0:47718d3154d9 | 39 | lcd_.FillPolygon(pt_, 3); |
MikamiUitOpen | 0:47718d3154d9 | 40 | } |
MikamiUitOpen | 0:47718d3154d9 | 41 | |
MikamiUitOpen | 0:47718d3154d9 | 42 | private: |
MikamiUitOpen | 0:47718d3154d9 | 43 | Point pt_[3]; |
MikamiUitOpen | 0:47718d3154d9 | 44 | }; |
MikamiUitOpen | 0:47718d3154d9 | 45 | } |
MikamiUitOpen | 0:47718d3154d9 | 46 | #endif // F746_RESET_BUTTON_HPP |