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: MCP23017 TCS3472_I2C WattBob_TextLCD mbed-rtos mbed
cardReader.h@12:814a8fdbb6f7, 2014-11-17 (annotated)
- Committer:
- IonSystems
- Date:
- Mon Nov 17 21:31:42 2014 +0000
- Revision:
- 12:814a8fdbb6f7
- Parent:
- 10:8c0696b99692
- Child:
- 13:0661d658d9d1
dispense and sort working well, also stored correct chip values
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| IonSystems | 6:e64796f1f384 | 1 | #include "mbed.h" |
| IonSystems | 6:e64796f1f384 | 2 | |
| IonSystems | 6:e64796f1f384 | 3 | DigitalIn cardBit1(p21); |
| IonSystems | 6:e64796f1f384 | 4 | DigitalIn cardBit2(p22); |
| IonSystems | 6:e64796f1f384 | 5 | DigitalIn cardBit3(p23); |
| IonSystems | 6:e64796f1f384 | 6 | DigitalIn cardBit4(p24); |
| IonSystems | 6:e64796f1f384 | 7 | DigitalIn cardBit5(p25); |
| IonSystems | 6:e64796f1f384 | 8 | DigitalIn cardBit6(p26); |
| IonSystems | 6:e64796f1f384 | 9 | DigitalIn cardDetect(p29); |
| IonSystems | 6:e64796f1f384 | 10 | |
| IonSystems | 6:e64796f1f384 | 11 | |
| IonSystems | 12:814a8fdbb6f7 | 12 | int cardValues[6] = {0,0,0,0,0,0}; |
| IonSystems | 6:e64796f1f384 | 13 | |
| IonSystems | 10:8c0696b99692 | 14 | bool cardDataAcquired = false; |
| IonSystems | 10:8c0696b99692 | 15 | |
| IonSystems | 6:e64796f1f384 | 16 | void cardAcquisition(){ |
| IonSystems | 6:e64796f1f384 | 17 | lcd->reset(); |
| IonSystems | 6:e64796f1f384 | 18 | lcd->locate(0,0); //Going to new line |
| IonSystems | 6:e64796f1f384 | 19 | if(cardBit1) lcd->printf("p1=1,"); |
| IonSystems | 6:e64796f1f384 | 20 | else lcd->printf("p1=0,"); |
| IonSystems | 12:814a8fdbb6f7 | 21 | cardValues[0] = cardBit1; |
| IonSystems | 6:e64796f1f384 | 22 | |
| IonSystems | 6:e64796f1f384 | 23 | if(cardBit2) lcd->printf("p2=1,"); |
| IonSystems | 6:e64796f1f384 | 24 | else lcd->printf("p2=0,"); |
| IonSystems | 12:814a8fdbb6f7 | 25 | cardValues[1] = cardBit2; |
| IonSystems | 6:e64796f1f384 | 26 | |
| IonSystems | 6:e64796f1f384 | 27 | if(cardBit3) lcd->printf("p3=1"); |
| IonSystems | 6:e64796f1f384 | 28 | else lcd->printf("p3=0"); |
| IonSystems | 12:814a8fdbb6f7 | 29 | cardValues[2] = cardBit3; |
| IonSystems | 6:e64796f1f384 | 30 | |
| IonSystems | 6:e64796f1f384 | 31 | lcd->locate(1,0); //Going to new line |
| IonSystems | 6:e64796f1f384 | 32 | |
| IonSystems | 6:e64796f1f384 | 33 | if(cardBit4) lcd->printf("p4=1"); |
| IonSystems | 6:e64796f1f384 | 34 | else lcd->printf("p4=0,"); |
| IonSystems | 12:814a8fdbb6f7 | 35 | cardValues[3] = cardBit4; |
| IonSystems | 6:e64796f1f384 | 36 | |
| IonSystems | 6:e64796f1f384 | 37 | |
| IonSystems | 6:e64796f1f384 | 38 | if(cardBit5) lcd->printf("p5=1,"); |
| IonSystems | 6:e64796f1f384 | 39 | else lcd->printf("p5=0,"); |
| IonSystems | 12:814a8fdbb6f7 | 40 | cardValues[4] = cardBit5; |
| IonSystems | 6:e64796f1f384 | 41 | |
| IonSystems | 6:e64796f1f384 | 42 | if(cardBit6) lcd->printf("p6=1"); |
| IonSystems | 6:e64796f1f384 | 43 | else lcd->printf("p6=0"); |
| IonSystems | 12:814a8fdbb6f7 | 44 | cardValues[5] = cardBit6; |
| IonSystems | 6:e64796f1f384 | 45 | |
| IonSystems | 6:e64796f1f384 | 46 | cardDataAcquired = true; |
| IonSystems | 6:e64796f1f384 | 47 | |
| IonSystems | 6:e64796f1f384 | 48 | } |
