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:62608d16d10f, committed 2020-09-29
- Comitter:
- ajp109
- Date:
- Tue Sep 29 09:55:15 2020 +0000
- Child:
- 1:3edadd59e1ef
- Commit message:
- Initial commit
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed-os.lib | 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 Sep 29 09:55:15 2020 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+
+int main()
+{
+ AnalogIn x(A0);
+ AnalogIn y(A1);
+ DigitalIn button(D2, PullUp);
+ Serial pc(USBTX, USBRX);
+
+ // Loop forever...
+ while (true) {
+ // Always print out the X and Y values
+ pc.printf("x:%d y:%d\n", x.read_u16(), y.read_u16());
+ if (button == false) {
+ // If the button is being pressed, add a suitable message
+ pc.printf("\t(button pressed)\n");
+ }
+ thread_sleep_for(500);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Tue Sep 29 09:55:15 2020 +0000 @@ -0,0 +1,1 @@ +https://github.com/armmbed/mbed-os/#aa70f680bb5755e8fea3f93fc6e04d9b3de235bb