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.
Diff: main.cpp
- Revision:
- 1:ca350ec7e01c
- Parent:
- 0:c57745f04ba3
--- a/main.cpp Fri Sep 30 02:28:58 2016 +0000
+++ b/main.cpp Thu Oct 06 05:04:57 2016 +0000
@@ -1,17 +1,17 @@
#include "mbed.h"
-AnalogIn sw1(A5);
-AnalogIn sw2(A4);
-BusOut leds(D7,D6,D5,D4);
+AnalogIn sw1(A5); //SW1入力設定
+AnalogIn sw2(A4); //SW2入力設定
+BusOut leds(D7,D6,D5,D4); //LED出力設定
int main()
{
- char x=0;
- while(1){
- for(x=0;x<=15;x++)
+ char x=0; //char型変数宣言
+ while(1){ //無限ループ
+ for(x=0;x<=15;x++) //x初期値0,xが15以下の間繰り返す,1周ごとにxに1足す
{
- leds = x;
- wait(0.25);
+ leds = x; //ledをxの値と同じ数2進数で出力
+ wait(0.25); //0.25秒待つ
}
}
}