Difference between revisions of "Component: Grove I2C Motor Driver (Mechatronics)"
From Flowcode Help
Jump to navigationJump to search (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...") |
|||
Line 20: | Line 20: | ||
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Grove_I2C_Motor_Driver.fcfx FC_Comp_Source_Grove_I2C_Motor_Driver.fcfx] | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Grove_I2C_Motor_Driver.fcfx FC_Comp_Source_Grove_I2C_Motor_Driver.fcfx] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Latest revision as of 11:29, 20 October 2023
Author | Matrix TSL |
Version | 1.0 |
Category | Mechatronics |
Contents
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 |