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.
main.cpp
00001 // --- reflective_rpm --- 00002 #include "mbed.h" 00003 #include "TextLCD.h" 00004 00005 TextLCD lcd(p24, p26, p27, p28, p29, p30); 00006 InterruptIn count(p5) ; 00007 Ticker min ; 00008 00009 int cnt = 0; 00010 int rpm = 0; 00011 00012 void count_r() 00013 { 00014 cnt++; 00015 } 00016 00017 void measure() 00018 { 00019 rpm = cnt * 5 ; 00020 } 00021 00022 int main() { 00023 lcd.cls(); 00024 count.rise(&count_r); 00025 min.attach(&measure ,3.0) ; 00026 while(1) { 00027 lcd.locate(1,0); 00028 lcd.printf("rpm [%4d]",rpm) ; 00029 } 00030 }
Generated on Wed Jul 13 2022 03:51:48 by
1.7.2