Skip to content

engr-ping/L298N

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

L298N

本文档为L298N H桥芯片控制电机驱动

其中分为代码部分和配置部分。

PIN IO和PWM 需要在程序运行的时候配置,不在驱动中配置。

更改说明

原先的代码时采用AUTOSAR思路写的代码,起始不符合Arduino 项目的逻辑 代码更改

使用说明

通道号如果为-1,表示不使用此功能 示例

#include "L298N.h"

L298N_PinType_t motor1Cfg = {16,17,NULL,-1,NULL};  //不使用pwm功能
L298N_t* motor1 = L298N_Create(&motor1Cfg);
motor1->Control(&motor1,MOTOR_FORWARD);
//motor1->Speed(&motor1,100);

默认定义了1块L298N支持2通道的电机,如果不够需要在编译选项中增加L298N的数量,如示例2块L298N

build_flags = -DL298N_NUM=2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published