Aidan Gallagher
/
ConsolTest
testing forking
Fork of ConsolTest by
main.cpp@2:7d53e9959b8f, 2015-06-30 (annotated)
- Committer:
- aidanPJG
- Date:
- Tue Jun 30 11:35:44 2015 +0000
- Revision:
- 2:7d53e9959b8f
- Parent:
- 1:860a22e395c9
- Child:
- 3:1ef4740c5a64
further;
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 | 0:7f5f4575bc6f | 9 | |
aidanPJG | 0:7f5f4575bc6f | 10 | while(1) { |
aidanPJG | 2:7d53e9959b8f | 11 | if (input == 1) |
aidanPJG | 0:7f5f4575bc6f | 12 | { |
aidanPJG | 2:7d53e9959b8f | 13 | pc.printf("true \n"); |
aidanPJG | 2:7d53e9959b8f | 14 | led = 1; |
aidanPJG | 0:7f5f4575bc6f | 15 | } |
aidanPJG | 2:7d53e9959b8f | 16 | else |
aidanPJG | 2:7d53e9959b8f | 17 | { |
aidanPJG | 2:7d53e9959b8f | 18 | pc.printf("true \n"); |
aidanPJG | 2:7d53e9959b8f | 19 | led = 0; |
aidanPJG | 0:7f5f4575bc6f | 20 | } |
aidanPJG | 0:7f5f4575bc6f | 21 | } |
aidanPJG | 0:7f5f4575bc6f | 22 | } |