【瑞萨FPB-RA6E1快速原型板】+机器人游戏主控项目(2)开源 (分步实验) - 瑞萨单片机论坛 - 电子技术论坛 - 广受欢迎的专业电子论坛! https://bbs.elecfans.com/jishu_2360535_1_1.html
快速搭建试验品验证项目,如视频。
控制步进电机驱动器,同时控制四路舵机机械臂视频
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);
}
}
瑞萨开发板控制步进电机驱动器,同时控制四路舵机机械臂。