快速搭建试验品验证项目,如视频。
控制步进电机驱动器,同时控制四路舵机机械臂视频
https://www.elecfans.com/v/386801/试用产品简介
源代码:
int v;
R_BSP_PinAccessEnable();
while(1) {
for ( v = 80; v > 60 ; v-- )
{
R_BSP_PinWrite(BSP_IO_PORT_01_PIN_13 , BSP_IO_LEVEL_HIGH);
R_BSP_SoftwareDelay(2, BSP_DELAY_UNITS_MILLISECONDS);
R_BSP_PinWrite( BSP_IO_PORT_01_PIN_13 , BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(18, BSP_DELAY_UNITS_MILLISECONDS);
}
for ( v = 80; v > 60 ; v-- )
{
R_BSP_PinWrite(BSP_IO_PORT_03_PIN_02 , BSP_IO_LEVEL_HIGH);
R_BSP_SoftwareDelay(1, BSP_DELAY_UNITS_MILLISECONDS);
R_BSP_PinWrite( BSP_IO_PORT_03_PIN_02 , BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(19, BSP_DELAY_UNITS_MILLISECONDS);
}
for ( v = 80; v > 60 ; v-- )
{
R_BSP_PinWrite(BSP_IO_PORT_04_PIN_02 , BSP_IO_LEVEL_HIGH);
R_BSP_SoftwareDelay(1, BSP_DELAY_UNITS_MILLISECONDS);
R_BSP_PinWrite( BSP_IO_PORT_04_PIN_02 , BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(19, BSP_DELAY_UNITS_MILLISECONDS);
}
for ( v = 80; v > 60 ; v-- )
{
R_BSP_PinWrite(BSP_IO_PORT_01_PIN_02 , BSP_IO_LEVEL_HIGH);
R_BSP_SoftwareDelay(1, BSP_DELAY_UNITS_MILLISECONDS);
R_BSP_PinWrite( BSP_IO_PORT_01_PIN_02 , BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(19, BSP_DELAY_UNITS_MILLISECONDS);
}
////
R_BSP_PinWrite( BSP_IO_PORT_03_PIN_03 , BSP_IO_LEVEL_LOW);
for ( v = 80; v > 60 ; v-- )
{
R_BSP_PinWrite(BSP_IO_PORT_01_PIN_13 , BSP_IO_LEVEL_HIGH);
R_BSP_SoftwareDelay(1, BSP_DELAY_UNITS_MILLISECONDS);
R_BSP_PinWrite( BSP_IO_PORT_01_PIN_13 , BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(19, BSP_DELAY_UNITS_MILLISECONDS);
}
for ( v = 80; v > 60 ; v-- )
{
R_BSP_PinWrite(BSP_IO_PORT_04_PIN_02 , BSP_IO_LEVEL_HIGH);
R_BSP_SoftwareDelay(2, BSP_DELAY_UNITS_MILLISECONDS);
R_BSP_PinWrite( BSP_IO_PORT_04_PIN_02 , BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(18, BSP_DELAY_UNITS_MILLISECONDS);
}
for ( v = 80; v > 60 ; v-- )
{
R_BSP_PinWrite(BSP_IO_PORT_01_PIN_02 , BSP_IO_LEVEL_HIGH);
R_BSP_SoftwareDelay(2, BSP_DELAY_UNITS_MILLISECONDS);
R_BSP_PinWrite( BSP_IO_PORT_01_PIN_02 , BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(18, BSP_DELAY_UNITS_MILLISECONDS);
}
R_BSP_PinWrite(BSP_IO_PORT_03_PIN_03 , BSP_IO_LEVEL_HIGH);
for ( v = 80; v > 60 ; v-- )
{
R_BSP_PinWrite(BSP_IO_PORT_03_PIN_02 , BSP_IO_LEVEL_HIGH);
R_BSP_SoftwareDelay(2, BSP_DELAY_UNITS_MILLISECONDS);
R_BSP_PinWrite( BSP_IO_PORT_03_PIN_02 , BSP_IO_LEVEL_LOW);
R_BSP_SoftwareDelay(18, BSP_DELAY_UNITS_MILLISECONDS);
}
}
瑞萨开发板控制步进电机驱动器,同时控制四路舵机机械臂。
更多回帖