Tim Johnson / Mbed 2 deprecated DignitalIn_values_seen_using_Tera_term

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
captaintim
Date:
Mon Dec 21 00:25:26 2015 +0000
Commit message:
DigitalIn program: while toggling one pin, a jumper to a 2nd pin allows Tera Term to post results to terminal

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
diff -r 000000000000 -r 75fa9df0f91d main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Dec 21 00:25:26 2015 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+
+/*comments: while toggling Pin 26 on and off, Pin 22 sees the change using Tera Term
+using https://developer.mbed.org/users/synvox/notebook/lpc1768-pinout-with-labelled-mbed-pins/ 
+by Nenad Milosevic as a guide to the complier name (P2_0) for pin 26 (p26 also works).
+verification: 
+1.Insert Jumper between Pins 26 and 22 on LPC1768
+2.Turn on your terminal program
+*/
+
+int on = 1;
+int off = 0;
+int i = 2.5;
+DigitalIn data(P2_4);
+
+/* the following declaration also works
+*DigitalIn data(p22);
+* there are two different ways of addressing the pins
+*/
+
+Serial pc(USBTX, USBRX);
+
+int main() {
+
+while(1){
+ DigitalOut (p26, on); //Pin 26 designation is p26
+ printf("value of p22 is: %d \r\n", data.read());
+ wait (i);
+ 
+  DigitalOut (P2_0, off); //Pin 26 designation is P2_0 
+  printf("value of p22 is: %d \r\n", data.read());
+ wait (i);
+ 
+   }
+}   
\ No newline at end of file
diff -r 000000000000 -r 75fa9df0f91d mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Dec 21 00:25:26 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4336505e4b1c
\ No newline at end of file