LCD 課題3 SWカウント

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
nakano_han
Date:
Thu Oct 06 05:03:54 2016 +0000
Parent:
2:9a1b3b957c98
Commit message:
LCD??3

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Sep 30 02:53:55 2016 +0000
+++ b/main.cpp	Thu Oct 06 05:03:54 2016 +0000
@@ -1,9 +1,9 @@
 #include "mbed.h"
 #include "TextLCD.h"
 
-TextLCD lcd(D8,D10,D11,D12,D13,D14); // rs, e, d4, d5, d6, d7)
-AnalogIn sw1(A5);
-AnalogIn sw2(A4);
+TextLCD lcd(D8,D10,D11,D12,D13,D14); // rs, e, d4, d5, d6, d7)      //LCD出力設定
+AnalogIn sw1(A5);       //スイッチ1入力設定
+AnalogIn sw2(A4);       //スイッチ2入力設定
 
 int main()
 {
@@ -21,7 +21,7 @@
     {
         if(sw1 == 1)    //SWが押されると{}内を実行
         {
-            wait(0.25);          //チャタリング除去
+            wait(0.25);      //チャタリング除去(スイッチの振動で入力が1回以上入るのを防ぐため)
             c++;        //カウント値に1足す
             
             if(c > 99)  //カウント値が99になったとき{}内実行