エレキジャック Web版 マイコン・カーを製作してみよう<9>で紹介したモーターの回転数を測定するプログラムです。http://www.eleki-jack.com/arm/2012/05/9.html

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
sunifu
Date:
Tue May 15 14:36:15 2012 +0000
Commit message:
1.0

Changed in this revision

TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 6b5ea81c387d TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Tue May 15 14:36:15 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#44f34c09bd37
diff -r 000000000000 -r 6b5ea81c387d main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue May 15 14:36:15 2012 +0000
@@ -0,0 +1,30 @@
+// --- reflective_rpm ---
+#include "mbed.h"
+#include "TextLCD.h"
+
+TextLCD lcd(p24, p26, p27, p28, p29, p30);
+InterruptIn count(p5)  ; 
+Ticker min ; 
+
+int cnt = 0;
+int rpm = 0;
+
+void count_r()
+{
+    cnt++; 
+}
+
+void measure()
+{
+    rpm = cnt * 5 ; 
+}
+
+int main() {
+    lcd.cls();
+    count.rise(&count_r); 
+    min.attach(&measure ,3.0) ; 
+    while(1) {
+        lcd.locate(1,0);
+        lcd.printf("rpm [%4d]",rpm) ;     
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 6b5ea81c387d mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue May 15 14:36:15 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/737756e0b479