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.
Revision 0:a085abcfd4f8, committed 2015-02-26
- Comitter:
- lanfear
- Date:
- Thu Feb 26 17:41:37 2015 +0000
- Commit message:
- Reproduces ticker/analogIn problem
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Feb 26 17:41:37 2015 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+
+DigitalIn Button1(p21);
+DigitalOut led1(LED1);
+
+AnalogIn Joystick1(p18);
+AnalogIn Ain3(p15);
+
+float LFT;
+int LowBatteryCounter=0;
+
+Ticker VoltageCheck_tick;
+
+void LowBatteryShutDown(void);
+
+
+int main()
+{
+ VoltageCheck_tick.attach(&LowBatteryShutDown,0.5);
+
+ while(1)
+ {
+ if (Button1==1)
+ {
+ LFT = Joystick1;
+ }
+ }
+}
+
+void LowBatteryShutDown(void)
+{
+ led1 = !led1;
+
+ if(Ain3<=0.81)
+ {
+ LowBatteryCounter++;
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Feb 26 17:41:37 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file