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:
- 7:11a20cba4eae
- Parent:
- 6:276d384f8483
- Child:
- 8:b162bf17271f
--- a/main.cpp Mon May 18 14:49:08 2015 +0000
+++ b/main.cpp Mon May 18 15:27:16 2015 +0000
@@ -13,27 +13,40 @@
BusOut minute(); //Minute hand
BusOut
InterruptIn hall(); //Hall sensor sensing interrupt
+Timer timer;
void hour_hand(void);
void minute_hand(void);
+void sensor();
-void sensor()
-{
-
-
-}
+int i=0;
int main()
{
hall.rise(&sensor); //rising edge operating
+ int a = 0;
while(1)
{
frame = 1;
hour_hand();
minute_hand();
+ if (i==10)
+ {
+ timer.start();
+ }
+ if (i==11)
+ {
+ timer.stop();
+
+ a = timer.read();
+ }
}
}
+void sensor()
+{
+ i=i+1;
+}
void hour_hand(void)
{
