![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
02/07/15
Dependencies: mbed
main.cpp
- Committer:
- aidanPJG
- Date:
- 2015-08-05
- Revision:
- 66:b642dac6f65d
- Parent:
- 65:08b3eb9b95dd
- Child:
- 67:04d67617131a
File content as of revision 66:b642dac6f65d:
#include "mbed.h" #include "Calculate.h" #include "Distance.h" #include "Data.h" #include "UserInput.h" #include "AddDetails.h" Serial pc(USBTX, USBRX); // tx, rx DigitalOut led1(LED1); DigitalOut led2(LED2); string handshake(); void run(); int main(void) { initialise(3); //used to create the Datalog file should happen once for every bend test if (handshake() == "success") { run(); } pc.printf("main after"); //it works now!!!!!!!!!!!!!!! led2= 1; } string handshake() { unsigned char input; pc.printf("a\n"); while(true) { input = pc.getc(); if (input == 'a') { led1 = 1; return "success" ;// run(); } } } void run() { int pins = inputNoOfPins(); //gets number of pins double distance = inputDistance(); //gets the distance between the pins calculate(distance,pins); }