Component: Grove I2C Motor Driver (Mechatronics): Difference between revisions
Appearance
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 28: | Line 28: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Frequency''' | ||
|- | |- | ||
| colspan="2" | Set the frequency of PWM (cycle length = 510, system clock = 16MHz) | | colspan="2" | Set the frequency of PWM (cycle length = 510, system clock = 16MHz) | ||
| Line 47: | Line 47: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | Sets up the I2C ready for communications | | colspan="2" | Sets up the I2C ready for communications | ||
| Line 61: | Line 61: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Speed''' | ||
|- | |- | ||
| colspan="2" | Sets the speed of a motor. | | colspan="2" | Sets the speed of a motor. | ||
| Line 85: | Line 85: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Stop''' | ||
|- | |- | ||
| colspan="2" | Stop one motor | | colspan="2" | Stop one motor | ||
| Line 105: | Line 105: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Communications | ||
|- | |- | ||
|- | |- | ||
| Line 152: | Line 152: | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Simulation | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:36, 13 July 2026
| Author | Matrix TSL |
| Version | 1.0 |
| Category | Mechatronics |
Grove I2C Motor Driver component
A grove board based around the L298P motor driver IC allowing control of two DC motors or a single stepper motor.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Grove_I2C_Motor_Driver.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Grove_I2C_Motor_Driver.fcfx
Macro reference
Frequency
| Frequency | |
| Set the frequency of PWM (cycle length = 510, system clock = 16MHz) | |
| FrequencySelection | |
| 1=31.372 KHz, 2=3.921 KHz, 3=490 Hz, 4=122 Hz, 5=30 Hz | |
| Return | |
Initialise
| Initialise | |
| Sets up the I2C ready for communications | |
| Return | |
Speed
| Speed | |
| Sets the speed of a motor. | |
| Motor | |
| 1=Motor1 / 2=Motor2 | |
| Speed | |
| Range: -255 to 255 where -255 = Full Backwards, 0=Stop, 255=Full Forwards | |
| Return | |
Stop
| Stop | |
| Stop one motor | |
| Motor | |
| 1 = Motor1 / 2 = Motor2 | |
| Return | |