Prova con controller motore
Dependencies: X-NUCLEO-IHM05A1 mbed
Fork of HelloWorld_IHM05A1 by
Diff: main.cpp
- Revision:
- 3:a6e155687c6a
- Parent:
- 2:c5f455885df7
- Child:
- 5:bc710d77d801
--- a/main.cpp Fri Apr 29 14:59:26 2016 +0000 +++ b/main.cpp Fri Apr 29 15:58:05 2016 +0000 @@ -48,8 +48,13 @@ /* Definitions ---------------------------------------------------------------*/ #ifdef TARGET_NUCLEO_F334R8 #define VREFA_PWM_PIN D11 +#define VREFB_PWM_PIN D9 +#elif TARGET_NUCLEO_F302R8 +#define VREFA_PWM_PIN D11 +#define VREFB_PWM_PIN D15 /* HW mandatory patch: bridge manually D9 with D15 */ #else #define VREFA_PWM_PIN D3 +#define VREFB_PWM_PIN D9 #endif /* Variables -----------------------------------------------------------------*/ @@ -125,7 +130,7 @@ //----- Initialization /* Initializing Motor Control Component. */ - motor = new L6208(D2, D8, D7, D4, D5, D6, VREFA_PWM_PIN, D9); + motor = new L6208(D2, D8, D7, D4, D5, D6, VREFA_PWM_PIN, VREFB_PWM_PIN); if (motor->Init(&initDeviceParameters) != COMPONENT_OK) exit(EXIT_FAILURE); /* Attaching and enabling an interrupt handler. */