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 Hibernus by
Diff: main.cpp
- Revision:
- 0:f9a13d4b41f3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Sep 08 18:01:22 2017 +0000
@@ -0,0 +1,42 @@
+/** Hibernus Library
+ * University of Southampton 2017
+ *
+ * Open-source liberary that enable any of your Mbed project work with transient enegy sources.
+ * In order to use this library include the "hibernus.h" header file, and use the "Hibernus()" method at the beginning of you main funtion.
+ * For more details and example see the "main.cpp" exampe file, and the attached documnetation
+ *
+ *
+ * Released under the MIT License: http://mbed.org/license/mit
+ */
+#include "hibernus.h"
+#include "mbed.h"
+
+DigitalOut bit0(LED1);
+DigitalOut bit1(LED2);
+DigitalOut bit2(LED3);
+DigitalOut bit3(LED4);
+
+int main()
+{
+ int c;
+ Hibernus();
+ while(1) // Binary counter
+ {
+ bit0 = 0; bit1 = 0; bit2 = 0; bit3 = 0; for(c = 0; c<2000000; c++); // 0
+ bit0 = 1; bit1 = 0; bit2 = 0; bit3 = 0; for(c = 0; c<2000000; c++); // 1
+ bit0 = 0; bit1 = 1; bit2 = 0; bit3 = 0; for(c = 0; c<2000000; c++); // 2
+ bit0 = 1; bit1 = 1; bit2 = 0; bit3 = 0; for(c = 0; c<2000000; c++); // 3
+ bit0 = 0; bit1 = 0; bit2 = 1; bit3 = 0; for(c = 0; c<2000000; c++); // 4
+ bit0 = 1; bit1 = 0; bit2 = 1; bit3 = 0; for(c = 0; c<2000000; c++); // 5
+ bit0 = 0; bit1 = 1; bit2 = 1; bit3 = 0; for(c = 0; c<2000000; c++); // 6
+ bit0 = 1; bit1 = 1; bit2 = 1; bit3 = 0; for(c = 0; c<2000000; c++); // 7
+ bit0 = 0; bit1 = 0; bit2 = 0; bit3 = 1; for(c = 0; c<2000000; c++); // 8
+ bit0 = 1; bit1 = 0; bit2 = 0; bit3 = 1; for(c = 0; c<2000000; c++); // 9
+ bit0 = 0; bit1 = 1; bit2 = 0; bit3 = 1; for(c = 0; c<2000000; c++); // 10
+ bit0 = 1; bit1 = 1; bit2 = 0; bit3 = 1; for(c = 0; c<2000000; c++); // 11
+ bit0 = 0; bit1 = 0; bit2 = 1; bit3 = 1; for(c = 0; c<2000000; c++); // 12
+ bit0 = 1; bit1 = 0; bit2 = 1; bit3 = 1; for(c = 0; c<2000000; c++); // 13
+ bit0 = 0; bit1 = 1; bit2 = 1; bit3 = 1; for(c = 0; c<2000000; c++); // 14
+ bit0 = 1; bit1 = 1; bit2 = 1; bit3 = 1; for(c = 0; c<2000000; c++); // 15
+ }
+}

