This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 5 years have passed since last update.

4.c. Using the Preloaded Demo Program (Pololu 3pi Robot User’s Guide) 日本語訳【非公式】

Last updated at Posted at 2019-05-18

これは Pololu 3pi Robot User’s Guide ≫ 4.c. Using the Preloaded Demo Program の非公式日本語訳です。
目次
前: 4.b. Powering Up Your 3pi
次: 4.d. Included Accessories

4.c. Using the Preloaded Demo Program

Your 3pi comes preloaded with a program that demonstrates most of its features and allows you to test that it is working correctly. When you first turn on your 3pi, you will hear a beep and see the words “Pololu 3pi Robot”, then “Demo Program” appear, indicating that you are running the demo program. If you hear a beep but do not see any text on the LCD, you may need to adjust the contrast potentiometer on the underside of the board. When the program has started successfully, press the B button to proceed to the main menu. Press C or A to scroll forward or backward through the menu, and press B to make a selection or to exit one of the demos. There are seven demos accessible from the menu:

3piには、その機能の大部分をデモンストレーションして、正しく動作することをあなたがテストすることを可能にするプログラムがプリロードされています。はじめて3piの電源を入れるとビープ音が鳴り、 "Pololu 3pi Robot" そして "Demo Program" が表示され、デモプログラムを実行していることを示します。ビープ音が聞こえてもLCDにテキストが表示されない場合は、ボードの裏側にあるコントラスト・ポテンショメータを調整する必要があります。プログラムが正常に起動したなら、Bボタンを押下してメインメニューに進みます。CまたはAを押してメニューを前後にスクロールし、Bを押して選択するかデモの1つを終了します。メニューを前後にスクロールするにはCまたはAを押し、選択するかデモの1つを終了するにはBを押します。メニューからアクセス可能な7つのデモがあります。メニューからアクセス可能なデモが7つあります:

  1. Battery: This demo displays the battery voltage in millivolts, which should be above 5000 (5.0 Volts) for a fully-charged set of batteries. Removing the jumper marked ADC6 will separate the battery voltage measurement circuit from the analog input, causing the number displayed to drop to some low value.
  2. LEDs: Blinks the red and green user LEDs on the underside of the board. If you have soldered in the optional user LEDs, they will also blink.
  3. Trimpot: Displays the position of the user trimmer potentiometer, which is located on the underside of the board, as a number between 0 and 1023. While displaying the value, this demo also blinks the LEDs and plays a note whose frequency is a function of the current reading. It is easiest to turn the trimpot using a 2mm flat-head screwdriver.
  4. Sensors: Show the current readings of the IR sensors using a bar graph. Bigger bars mean lower reflectance. Placing a reflective object such as your finger under one of the sensors will cause the corresponding reading to drop visibly on the graph. This demo also displays “C” to indicate that button C has an effect—press C and the IR emitters will be turned off. In indoor lighting conditions away from bright incandescent or halogen lights, all of the sensors should return entirely black readings with IR off. Removing the jumper marked PC5 disables control of the emitters, causing them to always be on.
  5. Motors: Hold down A or C to run the motor on the corresponding side, or hold down both buttons to run both motors simultaneously. The motors will gradually ramp up to speed; in your own programs, you can switch them on much more suddenly. Tap A or C to switch the corresponding motor to reverse (the button letter becomes lowercase if pressing it will drive the corresponding motor in reverse).
  6. Music: Plays an adaptation of J. S. Bach’s Fugue in D Minor for microcontroller and piezo, while scrolling a text display. This demonstrates the ability of the 3pi to play music in the background.
  7. Timer: A simple stopwatch. Press C to start or stop the stopwatch and A to reset. The stopwatch continues to count while you are exploring the other demos.
  1. 電池: このデモは電池電圧をミリボルト単位で表示します。完全に充電された電池セットの場合、5000(5.0ボルト)を超えるはずです。ADC6と刻印されたジャンパを取り外すと、電池電圧測定回路がアナログ入力から切り離され、表示されている数値がいくらか低い値に低下します。

  2. LED: ボードの裏面にある赤色と緑色のユーザーLEDを点滅します。オプションのユーザーLEDをはんだ付けした場合、それらも点滅します。

  3. トリミングポテンションメーター: ボードの裏面にあるユーザー・トリマー・ポテンショメーターの位置を0~1023の数字で表示します。値を表示している間、このデモはLEDを点滅し、現在のリード値を周波数として作用させたキーを再生します。トリミングポテンションメーターを回すには、2mmマイナスドライバーを使用するのが最も簡単です。

  4. センサー: 棒グラフを使用して赤外線センサーの現在のリード値を表示します。より大きなバーは反射率が低いことを意味します。指のような反射する物体をセンサーの下に置くと、対応するリード値が低下するのがグラフ上で見れます。このデモはボタンCに効果があること(ボタンCを押すとIRエミッタがオフになる)を示すために "C" も表示します。明るい白熱灯やハロゲンライトから離れた室内の照明条件では、すべてのセンサーがIRオフの状態で完全に黒のリード値を返すはずです。PC5と刻印されたジャンパを取り外すと、エミッターの制御が無効になり、それらが常にオンになります。

  5. モーター: AまたはCを長押しすると、対応する側のモーターが駆動し、両方のボタンを長押しすると両方のモーターが同時に駆動します。モーターは徐々にスピードを上げていきます。あなた自身のプログラムでは、それらを急激にオンにすることができます。AまたはCをタップすると、対応するモーターが逆転します(ボタンを押して対応するモーターが逆転すると、ボタン文字は小文字になります)。

  6. 音楽: テキスト表示をスクロールしながら、マイコンとピエゾ向けに編曲したJ.S.バッハのフーガ Dマイナー(二短調) を再生します。これはバックグラウンドで音楽を再生する3piの能力のデモンストレーションです。

  7. タイマー: シンプルなストップウォッチです。Cを押すとストップウォッチをスタート・ストップし、Aを押すとリセットします。ストップウォッチは他のデモを操作している間もカウントを続けます。

Note: If the 3pi receives any serial data while the demo program is waiting for a button press from the user, it will switch into serial slave mode. See Section 10.a for more information.

注意: デモプログラムがユーザーからのボタン押下を待っている間に3piがなんらかのシリアルデータを受信した場合、シリアルスレーブモードに切り替わります。詳細はセクション10.aを参照してください。

The source code for the demo program is included with the Pololu AVR C/C++ Library described in Section 6, in the folder examples\atmega328p\3pi-demo-program.

デモプログラムのソースコードは、セクション6で説明されている Pololu AVR C/C++ ライブラリの examples\atmega328p\3pi-demo-program フォルダに含まれています。

0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up