Michael Koppel
/
Digital_In
Revision 0:2af19ccb7fd2, committed 2015-02-12
- Comitter:
- m173318
- Date:
- Thu Feb 12 03:34:29 2015 +0000
- Commit message:
- Digital In
Changed in this revision
Digital_In.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 2af19ccb7fd2 Digital_In.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Digital_In.cpp Thu Feb 12 03:34:29 2015 +0000 @@ -0,0 +1,12 @@ +#include "mbed.h" +DigitalIn PinArray[5] = {p8, p9, p10, p11, p12}; //this line and the next 2 declare pins and LEDs +DigitalIn Pin7(p7); +DigitalIn Pin21_22_23[3] = {p21, p22, p23}; +int joe[3]; //declares a variable array joe +int main() { + while(1) { + joe[0] = Pin21_22_23[0].read(); //reads input from pin 21 to first part of the variable array + joe[1] = Pin21_22_23[1]; //reads input from pin 22 to second part of the variable array + joe[2] = Pin21_22_23[2].read(); //reads input from pin 23 to third part of the variable array + } +} \ No newline at end of file
diff -r 000000000000 -r 2af19ccb7fd2 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Feb 12 03:34:29 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e188a91d3eaa \ No newline at end of file