Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 8:41cd1fc8cbbe
- Parent:
- 7:e36f61608c10
- Child:
- 9:b1f53e4eb453
--- a/main.cpp Tue Aug 10 11:00:13 2021 +0000 +++ b/main.cpp Tue Aug 10 15:52:39 2021 +0000 @@ -51,7 +51,10 @@ Serial pc(USBTX,USBRX); DigitalOut pinStatusLED (D13); -DigitalIn pinButton (PC_13); + +DigitalIn pinButton (PC_8); +DigitalOut pinLedWhite (PC_6); +DigitalOut pinLedRed (PC_5); /* Still to allocate @@ -255,6 +258,7 @@ tickerPrint.detach(); printf("state = %d\r\n",state); + pinLedRed = 0; TestCompleteNotification();//send notification //deactivate motor //PrintThread.terminate();//terminate print thread @@ -274,7 +278,7 @@ testTimer.start();//start timer char spinState; - + pinLedRed = 1; //set up ticker to allow motor control thread to run periodically encoder.reset();//reset encoder @@ -303,7 +307,7 @@ semButton.wait(); int count = 0; - while(!pinButton.read()) + while(pinButton.read()) { count++; if (count ==1){ @@ -370,6 +374,10 @@ pinButton.rise(ISR_Button_Rise); pinButton.fall(ISR_Button_Fall); */ + pinButton.mode(PullDown); + pinLedWhite = 1; + + state = STATE_READY;//set state to READY //start all threads