Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SDR_Library/InitialMessage.hpp
- Committer:
- MikamiUitOpen
- Date:
- 2021-12-01
- Revision:
- 2:fa94a6a917dd
- Parent:
- 0:4037028ba61a
File content as of revision 2:fa94a6a917dd:
//-------------------------------------------------------------
// 実行開始時のターミナルへメッセージの送信
//
// 2019/09/17, Copyright (c) 2019 MIKAMI, Naoki
//-------------------------------------------------------------
#include "mbed.h"
#pragma diag_suppress 870 // マルチバイト文字使用の警告抑制のため
#include <string>
enum AmFm { AM, FM }; // メッセージが AM 用か FM 用かを指定する
// str 2行目に表示するメッセージ
// af メーッセージが AM 用か FM 用かを指定
// sp メーッセージを出力するシリアルポート
void InitialMessage(string str, AmFm af, Serial &sp)
{
sp.printf("\r\n");
if (af == AM)
{
sp.printf("SDR で AM 放送を受信します.\r\n");
sp.printf((str + "\r\n").c_str());
sp.printf("0: NHK 第1\r\n1: NHK 第2\r\n2: AFN Tokyo\r\n3: TBS ラジオ\r\n"
"4: 文化放送\r\n5: ニッポン放送\r\n6: ラジオ日本\r\n\n");
sp.printf("'0' ~ '6' のキーで選局できます.\r\n");
sp.printf("'0' ~ '6', 'Enter' キー以外は何も反応しません.\r\n");
}
else
{
sp.printf("\r\nSDR で FM 復調を実行します.\r\n");
sp.printf((str + "\r\n").c_str());
sp.printf("0 か 1 を入力してください.\r\n");
sp.printf("'0', '1', 'Enter' キー以外は何も反応しません.\r\n");
}
sp.printf("'Enter' キーは CR/LF するだけです.\r\n\n");
sp.putc('0');
}