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:
- 6:276d384f8483
- Parent:
- 5:2ead41027963
- Child:
- 7:11a20cba4eae
--- a/main.cpp Fri Apr 03 14:11:53 2015 +0000
+++ b/main.cpp Mon May 18 14:49:08 2015 +0000
@@ -1,9 +1,9 @@
#include "mbed.h"
/*****************************************************************************
-* *
-* *
-* *
+******************************************************************************
+******************************************************************************
+******************************************************************************
******************************************************************************/
DigitalOut myled(LED1);
@@ -11,9 +11,13 @@
DigitalOut dot_Point(); //Time point
BusOut hour(); //Hour hand
BusOut minute(); //Minute hand
+BusOut
InterruptIn hall(); //Hall sensor sensing interrupt
-void sensing()
+void hour_hand(void);
+void minute_hand(void);
+
+void sensor()
{
@@ -21,10 +25,27 @@
int main()
{
- hall.rise(&sensing); //rising edge operating
+ hall.rise(&sensor); //rising edge operating
while(1)
{
-
+ frame = 1;
+ hour_hand();
+ minute_hand();
}
+}
+
+void hour_hand(void)
+{
+ hour = 0x1F;
+ wait ();
+ hour = 0x00;
+ wait ();
+}
+void minute_hand(void)
+{
+ minute = 0x0FF;
+ wait ();
+ minute = 0x00;
+ wait();
}
\ No newline at end of file
