02/07/15

Dependencies:   mbed

Dependents:   TabbedGUIMbed

Committer:
aidanPJG
Date:
Wed Jul 29 15:27:15 2015 +0000
Revision:
59:2cbbd6fea55b
Parent:
56:bf08d9e50ccc
Child:
61:e7f2a0e38360
Working with GUItabbed to an extent. Need to get the read working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ADAMSTRUTT 17:d9fb4a3780c7 1 #include "mbed.h"
ADAMSTRUTT 17:d9fb4a3780c7 2 #include "Calculate.h"
ADAMSTRUTT 17:d9fb4a3780c7 3 #include "Distance.h"
ADAMSTRUTT 35:085a674c9fdf 4 #include "Data.h"
aidanPJG 48:e9578f56534a 5 #include "UserInput.h"
aidanPJG 56:bf08d9e50ccc 6 #include "AddDetails.h"
ADAMSTRUTT 20:0b2279011691 7 //#include "Counter.h
ADAMSTRUTT 35:085a674c9fdf 8
aidanPJG 25:bab86a12e9ad 9 Serial pc(USBTX, USBRX); // tx, rx
aidanPJG 59:2cbbd6fea55b 10 DigitalOut led1(LED1);
aidanPJG 59:2cbbd6fea55b 11 DigitalOut led2(LED2);
aidanPJG 59:2cbbd6fea55b 12 void handshake();
aidanPJG 59:2cbbd6fea55b 13 void run();
ADAMSTRUTT 17:d9fb4a3780c7 14
ADAMSTRUTT 20:0b2279011691 15 int main(void)
aidanPJG 7:d6f78ba7c5f7 16 {
aidanPJG 59:2cbbd6fea55b 17 initialise(3); //used to create the Datalog file should happen once for every bend test
aidanPJG 59:2cbbd6fea55b 18 handshake();
aidanPJG 59:2cbbd6fea55b 19 run();
aidanPJG 59:2cbbd6fea55b 20 }
aidanPJG 59:2cbbd6fea55b 21 void handshake()
aidanPJG 59:2cbbd6fea55b 22 {
aidanPJG 59:2cbbd6fea55b 23 unsigned char input;
aidanPJG 59:2cbbd6fea55b 24 pc.printf("a\n");
aidanPJG 59:2cbbd6fea55b 25
aidanPJG 59:2cbbd6fea55b 26 while(true)
aidanPJG 59:2cbbd6fea55b 27 {
aidanPJG 59:2cbbd6fea55b 28 input = pc.getc();
aidanPJG 59:2cbbd6fea55b 29 if (input == 'a')
aidanPJG 59:2cbbd6fea55b 30 {
aidanPJG 59:2cbbd6fea55b 31 led1 = 1;
aidanPJG 59:2cbbd6fea55b 32 run();
aidanPJG 59:2cbbd6fea55b 33 }
aidanPJG 59:2cbbd6fea55b 34 }
aidanPJG 59:2cbbd6fea55b 35 }
aidanPJG 59:2cbbd6fea55b 36 void run()
aidanPJG 59:2cbbd6fea55b 37 {
aidanPJG 55:58e9836f5ad1 38 int pins = inputNoOfPins(); //gets number of pins
aidanPJG 55:58e9836f5ad1 39 double distance = inputDistance(); //gets the distance between the pins
aidanPJG 59:2cbbd6fea55b 40 calculate(distance,pins);
aidanPJG 59:2cbbd6fea55b 41 }