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.
Dependents: Flasher_HelloWorld
Revision 1:e94a73b015cc, committed 2011-02-26
- Comitter:
- p07gbar
- Date:
- Sat Feb 26 13:17:23 2011 +0000
- Parent:
- 0:5c6eb2d20a5a
- Commit message:
- V1.1
Changed in this revision
| Flasher.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Flasher.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Flasher.cpp Sat Feb 19 14:27:21 2011 +0000
+++ b/Flasher.cpp Sat Feb 26 13:17:23 2011 +0000
@@ -137,3 +137,14 @@
return statein;
}
}
+
+Flasher& Flasher::operator= (int statein)
+{
+ updateFlash(statein);
+ return *this;
+}
+
+Flasher::operator int()
+{
+ return state;
+}
--- a/Flasher.h Sat Feb 19 14:27:21 2011 +0000
+++ b/Flasher.h Sat Feb 26 13:17:23 2011 +0000
@@ -60,11 +60,11 @@
* int main() {
* while(1){
* wait(5);
- * myFlasher.updateFlash(ON);
+ * myFlasher = ON;
* wait(5);
* myFlasher.updateFlash(SLOW);
* wait(5);
- * myFlasher.updateFlash(MEDIUM);
+ * myFlasher = MEDIUM;
* wait(5);
* myFlasher.updateFlash(QUICK);
* wait(5);
@@ -147,7 +147,19 @@
float getFlashTime(int statein);
+/** Sets state quickly
+ *
+ * @param statein State to change to
+ */
+Flasher& operator= (int statein);
+
+/** Gets State quickly
+ *
+ * @param returns Current state
+ */
+
+operator int();
private: