![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
hello
Dependencies: X_NUCLEO_IHM01A1
Fork of HelloWorld_IHM01A1_2Motors_mbedOS by
Diff: main.cpp
- Revision:
- 28:3f17a4152bcf
- Parent:
- 24:8cb3c4ad055f
- Child:
- 29:526970c1d998
--- a/main.cpp Fri Oct 28 13:53:06 2016 +0000 +++ b/main.cpp Wed Mar 01 13:32:24 2017 +0000 @@ -85,10 +85,12 @@ /* Initializing Motor Control Components. */ motor1 = new L6474(D2, D8, D7, D9, D10, dev_spi); motor2 = new L6474(D2, D8, D4, D3, D10, dev_spi); - if (motor1->Init() != COMPONENT_OK) + if (motor1->Init() != COMPONENT_OK) { exit(EXIT_FAILURE); - if (motor2->Init() != COMPONENT_OK) + } + if (motor2->Init() != COMPONENT_OK) { exit(EXIT_FAILURE); + } /* Printing to the console. */ printf("Motor Control Application Example for 2 Motors\r\n\n"); @@ -282,8 +284,7 @@ motor2->SetHome(); /* Infinite Loop. */ - while(1) - { + while(true) { /* Requesting to go to a specified position. */ motor1->GoTo(STEPS >> 1); motor2->GoTo(- (STEPS >> 1));