|
|||||||||||
Technical Support On-Line Manuals µVision4 User's Guide (Japanese) µVision4 の概要 ユーザインタフェース アプリケーションの作成 ユーティリティ デバッグ デバッグコマンド デバッグ関数 シミュレーション デジタル入力 プッシュボタン 割り込みシグナル インパルスパターン アナログ入力 方形波シグナル のこぎり波シグナル 正弦波 ノイズシグナル シグナルの組み合わせ UART 通信 CAN 通信 ダイアログページ 仮想シミュレーションレジスタ(VTREG) 受信メッセージのシミュレート 送信メッセージの処理 定期的なメッセージの送信 I²C 通信 I²C の概念 I²C シミュレーション 仮想シミュレーションレジスタ(VTREG) I²C デバイスのシミュレーション アプリケーション例 SPI シミュレーション フラッシュプログラミング ダイアログ サンプルプログラム コマンドライン 付録 |
正弦波次のシグナル関数テンプレートを使用して、正弦波シグナルを生成できます。入力シグナルは、VTREG AIN2 に提供されています。変数ボルト、周波数、オフセット、および期間を使用して、正弦波シグナルを調整できます。 /*----------------------------------------------------------------------*/ /* Generate Sine Wave Signal on AD Channel 2 */ /*----------------------------------------------------------------------*/ // signal void AIN2_Sine (void) { float volts; // peak-to-peak voltage float frequency; // output frequency in Hz float offset; // voltage offset float duration; // duration in Seconds float val; long i, end; volts = 1.4; offset = 1.6; frequency = 1800; duration = 0.1; printf ("Sine Wave Signal on AD Channel 2.\n"); end = (duration * 100000); for (i = 0 ; i < end; i++) { val = __sin (frequency * (((float) STATES) / CLOCK) * 2 * 3.1415926); AIN2 = (val * volts) + offset; swatch (0.00001); // in 10 uSec steps } } define button "AIN2 Sin","AIN2_Sine()" 上の設定では、次の出力が生成されます。
| ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.