![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
02/07/15
Dependencies: mbed
main.cpp@3:1ef4740c5a64, 2015-07-01 (annotated)
- Committer:
- aidanPJG
- Date:
- Wed Jul 01 09:55:47 2015 +0000
- Revision:
- 3:1ef4740c5a64
- Parent:
- 2:7d53e9959b8f
- Child:
- 4:e61cd14ec4f0
changes;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aidanPJG | 0:7f5f4575bc6f | 1 | #include "mbed.h" |
aidanPJG | 0:7f5f4575bc6f | 2 | |
aidanPJG | 0:7f5f4575bc6f | 3 | Serial pc(USBTX, USBRX); // tx, rx |
aidanPJG | 0:7f5f4575bc6f | 4 | DigitalIn input(p8); |
aidanPJG | 2:7d53e9959b8f | 5 | DigitalOut led(LED1); |
aidanPJG | 0:7f5f4575bc6f | 6 | |
aidanPJG | 0:7f5f4575bc6f | 7 | int main() { |
aidanPJG | 2:7d53e9959b8f | 8 | pc.printf("new program \n"); |
aidanPJG | 3:1ef4740c5a64 | 9 | |
aidanPJG | 0:7f5f4575bc6f | 10 | while(1) { |
aidanPJG | 3:1ef4740c5a64 | 11 | if (input) |
aidanPJG | 0:7f5f4575bc6f | 12 | { |
aidanPJG | 3:1ef4740c5a64 | 13 | pc.printf("digital in = 1 \n"); |
aidanPJG | 2:7d53e9959b8f | 14 | led = 1; |
aidanPJG | 3:1ef4740c5a64 | 15 | // wait(0); |
aidanPJG | 0:7f5f4575bc6f | 16 | } |
aidanPJG | 2:7d53e9959b8f | 17 | else |
aidanPJG | 2:7d53e9959b8f | 18 | { |
aidanPJG | 3:1ef4740c5a64 | 19 | pc.printf("digital in = 0 \n"); |
aidanPJG | 3:1ef4740c5a64 | 20 | led = 0; |
aidanPJG | 3:1ef4740c5a64 | 21 | // wait(0); |
aidanPJG | 2:7d53e9959b8f | 22 | led = 0; |
aidanPJG | 0:7f5f4575bc6f | 23 | } |
aidanPJG | 0:7f5f4575bc6f | 24 | } |
aidanPJG | 0:7f5f4575bc6f | 25 | } |