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:7071e3e01101, committed 2011-10-04
- Comitter:
- chris
- Date:
- Tue Oct 04 08:57:37 2011 +0000
- Commit message:
- First revision
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 Tue Oct 04 08:57:37 2011 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+
+int read_digital(void) {
+ DigitalIn mydigital(p20);
+ return(mydigital.read());
+}
+
+float read_analog(void) {
+ AnalogIn myanalog(p20);
+ return(myanalog.read());
+}
+
+int main() {
+ while(1) {
+
+ printf("Digital reading : %d\n",read_digital());
+ wait(1.0);
+ printf("Analog reading : %.2f\n",read_analog());
+ wait(1.0);
+
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Oct 04 08:57:37 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912