Embedded System CW2
Dependencies: Crypto_light mbed-rtos mbed
Fork of ES_CW2_Starter by
Revision 3:569b35e2a602, committed 2018-03-01
- Comitter:
- estott
- Date:
- Thu Mar 01 09:41:46 2018 +0000
- Parent:
- 2:4e88faab6988
- Child:
- 4:bcd27085832d
- Commit message:
- Changed library version
Changed in this revision
--- a/main.cpp Tue Feb 28 14:44:23 2017 +0000 +++ b/main.cpp Thu Mar 01 09:41:46 2018 +0000 @@ -1,5 +1,4 @@ #include "mbed.h" -#include "rtos.h" //Photointerrupter input pins #define I1pin D2 @@ -38,7 +37,7 @@ //const int8_t stateMap[] = {0x07,0x01,0x03,0x02,0x05,0x00,0x04,0x07}; //Alternative if phase order of input or drive is reversed //Phase lead to make motor spin -const int8_t lead = -2; //2 for forwards, -2 for backwards +const int8_t lead = 2; //2 for forwards, -2 for backwards //Status LED DigitalOut led1(LED1); @@ -88,7 +87,7 @@ int8_t motorHome() { //Put the motor in drive state 0 and wait for it to stabilise motorOut(0); - wait(1.0); + wait(2.0); //Get the rotor state return readRotorState(); @@ -97,11 +96,11 @@ //Main int main() { int8_t orState = 0; //Rotot offset at motor state 0 + int8_t intState = 0; + int8_t intStateOld = 0; //Initialise the serial port Serial pc(SERIAL_TX, SERIAL_RX); - int8_t intState = 0; - int8_t intStateOld = 0; pc.printf("Hello\n\r"); //Run the motor synchronisation
--- a/mbed-os.lib Tue Feb 28 14:44:23 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://github.com/ARMmbed/mbed-os/#34c1facf42a174f47fdf9002cd8c6bf10ac41744
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Mar 01 09:41:46 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/7130f322cb7e \ No newline at end of file