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.
Dependencies: mbed
Fork of zProject_RTC_display_alarm by
Diff: main.cpp
- Revision:
- 1:ba7154d2d7ca
- Parent:
- 0:b2064b3558b6
- Child:
- 2:6b4dda997dc0
diff -r b2064b3558b6 -r ba7154d2d7ca main.cpp
--- a/main.cpp Sat Dec 05 10:02:26 2015 +0000
+++ b/main.cpp Sat Dec 05 14:01:16 2015 +0000
@@ -5,10 +5,26 @@
DS1307 myrtc(I2C_SDA,I2C_SCL);
DigitDisplay display(D7,D8);
DigitalOut buzzer(D6);
-
-int main() {
+BusIn b(D9,D10,D11);
+BusOut led(D2,D3,D4,D5);
+int mode=0;
+int main()
+{
+ b.mode(PullUp);
// DisplayTime();
- display.Displayset(4,6,4,7);
+ display.Displayset(0x77,5,5,5);
+ while(1)
+ {
+ display.getButtonState();
+ if(b==0b011){led=0b100;mode=1;}
+ else if(b==0b101){led=0b010;mode=2;}
+ else if(b==0b110){led=0b001;mode=3;}
+
+ printf("%d",mode);
+ /*if(mode==1)led=0b100;
+ else if(mode==2)led=0b010;
+ else if(mode==3)led=0b001;*/
+ }
}
void DisplayTime()
