Bresdin O'Malley
/
CapKey_46_v3_sensors
Fork of CapKey_46_v2_sensors by
Revision 5:5d684bfc69d6, committed 2015-02-25
- Comitter:
- bomalley
- Date:
- Wed Feb 25 21:33:35 2015 +0000
- Parent:
- 4:34ca86236686
- Commit message:
- Working however needs cleanup. ; Change names of ; Relays; CapKeys; get rid of capRST - not being needed anymore
Changed in this revision
cdg_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 34ca86236686 -r 5d684bfc69d6 cdg_main.cpp --- a/cdg_main.cpp Thu Nov 13 03:24:24 2014 +0000 +++ b/cdg_main.cpp Wed Feb 25 21:33:35 2015 +0000 @@ -24,9 +24,10 @@ #define CHNLLCDPRINT "CH-%1d" #define RASPIOUTDBG "PIOUT = %d \n\r" -DigitalOut Relays[NUMREL] = {D10,D11,D12,D13,PTC13,PTC16}; // corresponds to touches 1,2,3,4 -DigitalIn capKeys[NUMREL] = {D2,D4,D6,D8,PTC6,PTC7}; -DigitalOut capRST[NUMREL] = {D3,D5,D7,D9,PTC10,PTC11}; +//Relay are the outputs to the KL and input to the rasb pi --> +DigitalOut Relays[NUMREL] = {D10,D11,D12,PTB18,PTC13,PTC16}; // corresponds to touches 1,2,3,4 // +DigitalIn capKeys[NUMREL] = {D2,D4,D6,D8,PTC6,PTC7}; //input +DigitalOut capRST[NUMREL] = {D3,D5,D7,D9,PTC10,PTC11}; //DigitalIn sendKey(PTC3); // on board buttons just use 1 for test DigitalOut REDLed(LED_RED); // red led DigitalOut GREENLed(PTD5); // green led @@ -84,7 +85,7 @@ for (i=0; i<NUMREL; i++){ Relays[i].write(RELAY_OFF); capRST[i].write(HIGH); - capKeys[i].mode(PullDown); // click out the pull-up resistor looks like it needs a pulldown + capKeys[i].mode(PullUp); // click out the pull-up resistor looks like it needs a pulldown } while (true) { @@ -95,7 +96,7 @@ // read the state of the pushbutton value: if(OKtoRead) { for (i=TESTCHANNEL; i<NUMREL; i++){ - if (capKeys[i] == HIGH) { + if (capKeys[i] == LOW) { channelSelect = i; channelDisplay = channelSelect +1; buttonVal = true; // Got a touch
diff -r 34ca86236686 -r 5d684bfc69d6 mbed.bld --- a/mbed.bld Thu Nov 13 03:24:24 2014 +0000 +++ b/mbed.bld Wed Feb 25 21:33:35 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/9ad691361fac \ No newline at end of file