![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
02/07/15
Dependencies: mbed
AddDetails.cpp@71:60f06e7e50a3, 2015-09-03 (annotated)
- Committer:
- aidanPJG
- Date:
- Thu Sep 03 15:32:01 2015 +0000
- Revision:
- 71:60f06e7e50a3
- Parent:
- 56:bf08d9e50ccc
tried to add date but it failed;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aidanPJG | 56:bf08d9e50ccc | 1 | #include "mbed.h" |
aidanPJG | 56:bf08d9e50ccc | 2 | #include <utility> |
aidanPJG | 56:bf08d9e50ccc | 3 | #include <string> |
aidanPJG | 56:bf08d9e50ccc | 4 | |
aidanPJG | 56:bf08d9e50ccc | 5 | extern Serial pc; |
aidanPJG | 56:bf08d9e50ccc | 6 | DigitalOut myled(LED1); |
aidanPJG | 56:bf08d9e50ccc | 7 | |
aidanPJG | 56:bf08d9e50ccc | 8 | string details() //not used curr. |
aidanPJG | 56:bf08d9e50ccc | 9 | { |
aidanPJG | 56:bf08d9e50ccc | 10 | // pc.printf("Ready to Read.\n"); |
aidanPJG | 56:bf08d9e50ccc | 11 | // pc.printf("Enter the number of sensors\n"); |
aidanPJG | 56:bf08d9e50ccc | 12 | string details[6]; |
aidanPJG | 56:bf08d9e50ccc | 13 | |
aidanPJG | 56:bf08d9e50ccc | 14 | for(int i = 0; i<5 ; i++) |
aidanPJG | 56:bf08d9e50ccc | 15 | { |
aidanPJG | 56:bf08d9e50ccc | 16 | while(1) |
aidanPJG | 56:bf08d9e50ccc | 17 | { |
aidanPJG | 56:bf08d9e50ccc | 18 | if (pc.readable()) |
aidanPJG | 56:bf08d9e50ccc | 19 | { |
aidanPJG | 56:bf08d9e50ccc | 20 | pc.scanf("%s", &details[i]); |
aidanPJG | 56:bf08d9e50ccc | 21 | break; |
aidanPJG | 56:bf08d9e50ccc | 22 | myled = 1; |
aidanPJG | 56:bf08d9e50ccc | 23 | } |
aidanPJG | 56:bf08d9e50ccc | 24 | } |
aidanPJG | 56:bf08d9e50ccc | 25 | } |
aidanPJG | 56:bf08d9e50ccc | 26 | if (pc.readable()) |
aidanPJG | 56:bf08d9e50ccc | 27 | { |
aidanPJG | 56:bf08d9e50ccc | 28 | string start; |
aidanPJG | 56:bf08d9e50ccc | 29 | pc.scanf("%s", start); |
aidanPJG | 56:bf08d9e50ccc | 30 | if (start == "go") |
aidanPJG | 56:bf08d9e50ccc | 31 | { |
aidanPJG | 56:bf08d9e50ccc | 32 | printf("herema"); |
aidanPJG | 56:bf08d9e50ccc | 33 | } |
aidanPJG | 56:bf08d9e50ccc | 34 | |
aidanPJG | 56:bf08d9e50ccc | 35 | return("foo"); |
aidanPJG | 56:bf08d9e50ccc | 36 | } |
aidanPJG | 56:bf08d9e50ccc | 37 | } |