Tim Johnson / Mbed 2 deprecated DignitalIn_values_seen_using_Tera_term

Dependencies:   mbed

Revision:
0:75fa9df0f91d
--- /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