CreaLab / Mbed 2 deprecated MJBot2

Dependencies:   LED_WS2812 mbed X_NUCLEO_IHM02A1

Files at this revision

API Documentation at this revision

Comitter:
Davidroid
Date:
Thu Nov 26 16:24:52 2015 +0000
Parent:
1:9f1974b0960d
Child:
3:fd280b953f77
Commit message:
+ Updated with the new version of the X_NUCLEO_IHM02A1 library.

Changed in this revision

X_NUCLEO_IHM02A1.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/X_NUCLEO_IHM02A1.lib	Wed Nov 25 12:00:34 2015 +0000
+++ b/X_NUCLEO_IHM02A1.lib	Thu Nov 26 16:24:52 2015 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ST-Expansion-SW-Team/code/X_NUCLEO_IHM02A1/#b78dab6d2c58
+https://developer.mbed.org/teams/ST-Expansion-SW-Team/code/X_NUCLEO_IHM02A1/#381d76f5b0b4
--- a/main.cpp	Wed Nov 25 12:00:34 2015 +0000
+++ b/main.cpp	Thu Nov 26 16:24:52 2015 +0000
@@ -1,7 +1,7 @@
 /**
  ******************************************************************************
  * @file    main.cpp
- * @author  Davide Aliprandi / AST
+ * @author  Davide Aliprandi, STMicrolectronics
  * @version V1.0.0
  * @date    November 4th, 2015
  * @brief   mbed test application for the STMicrolectronics X-NUCLEO-IHM02A1
@@ -76,12 +76,23 @@
 {
     /*----- Initialization. -----*/
 
+    /* Initializing SPI bus. */
+    DevSPI dev_spi(D11, D12, D13);
 
-    /* Initializing SPI bus. */
-    DevSPI dev_spi(D11, D12, D3);
+    /* Initializing Motor Control Expansion Board.
+
+       You can stack up to 4 expansion boards together, each one controlling
+       two stepper motors in daisy-chain configuration, so that motors will
+       be in daisy-chain configuration two-by-two.
 
-    /* Initializing Motor Control Expansion Board. */
-    x_nucleo_ihm02a1 = X_NUCLEO_IHM02A1::Instance(A4, A5, D4, A2, &dev_spi);
+       Concerning the SSEL pin of SPI communication, expansion boards must
+       be in one of the following configurations:
+         + SB_23 resistor connected only --> SSEL on pin A2;
+         + SB_7  resistor connected only --> SSEL on pin D2;
+         + SB_8  resistor connected only --> SSEL on pin D10;
+         + SB_9  resistor connected only --> SSEL on pin D5.
+    */
+    x_nucleo_ihm02a1 = new X_NUCLEO_IHM02A1(A4, A5, D4, A2, &dev_spi);
 
     /* Building a list of motor control components. */
     L6470 **motors = x_nucleo_ihm02a1->GetComponents();