main.cpp@1:4d08e0ebf5dd, 2011-10-21 (annotated)
- Committer:
- chris
- Date:
- Fri Oct 21 23:02:16 2011 +0000
- Revision:
- 1:4d08e0ebf5dd
- Parent:
- 0:e98d1c2b16c6
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris | 0:e98d1c2b16c6 | 1 | #include "mbed.h" |
chris | 0:e98d1c2b16c6 | 2 | #include "USBKeyboard.h" |
chris | 0:e98d1c2b16c6 | 3 | |
chris | 0:e98d1c2b16c6 | 4 | USBKeyboard key; |
chris | 0:e98d1c2b16c6 | 5 | |
chris | 0:e98d1c2b16c6 | 6 | DigitalIn din(p14); |
chris | 0:e98d1c2b16c6 | 7 | DigitalOut led1(LED1); |
chris | 0:e98d1c2b16c6 | 8 | |
chris | 0:e98d1c2b16c6 | 9 | int main(void) { |
chris | 0:e98d1c2b16c6 | 10 | while (1) { |
chris | 0:e98d1c2b16c6 | 11 | if (din) { |
chris | 0:e98d1c2b16c6 | 12 | led1 = !led1; |
chris | 0:e98d1c2b16c6 | 13 | |
chris | 0:e98d1c2b16c6 | 14 | key.printf("Mr A N Other\t"); // Name on card |
chris | 0:e98d1c2b16c6 | 15 | key.printf("4929780506391234\t"); // Card number |
chris | 0:e98d1c2b16c6 | 16 | key.printf("0611\t"); // Valid from |
chris | 0:e98d1c2b16c6 | 17 | key.printf("0513\t"); // Valid to |
chris | 0:e98d1c2b16c6 | 18 | key.printf("123\t"); // CVC |
chris | 0:e98d1c2b16c6 | 19 | wait(1); |
chris | 0:e98d1c2b16c6 | 20 | key.printf("\n"); // Submit |
chris | 0:e98d1c2b16c6 | 21 | wait(1); |
chris | 0:e98d1c2b16c6 | 22 | |
chris | 0:e98d1c2b16c6 | 23 | } |
chris | 0:e98d1c2b16c6 | 24 | } |
chris | 0:e98d1c2b16c6 | 25 | } |