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
Diff: main.cpp
- Revision:
- 0:fdcc47f2da83
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Apr 25 07:58:41 2019 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+
+DigitalIn Limits[] = {
+ DigitalIn(A2),
+ DigitalIn(A3),
+ DigitalIn(D2),
+ DigitalIn(D3)
+};
+
+DigitalOut led(LED1);
+Serial pc(USBTX,USBRX);
+
+int main()
+{
+ Limits[0].mode(PullUp);
+ Limits[1].mode(PullUp);
+ Limits[2].mode(PullUp);
+ Limits[3].mode(PullUp);
+ while (1) {
+ pc.printf("\033[2J\033[1;1H limit1_%c",(Limits[0] == 1)? 'F':'T');
+ pc.printf("\033[2;1H limit2_%c",(Limits[1] == 1)? 'F':'T');
+ pc.printf("\033[3;1H limit3_%c",(Limits[2] == 1)? 'F':'T');
+ pc.printf("\033[4;1H limit4_%c",(Limits[3] == 1)? 'F':'T');
+ wait(0.1);
+ }
+}