Skip to content

cjz-wr/MX1508-Mircopython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MX1508-Mircopython

这是一个基于mircopython的mx1506驱动

该驱动的io口例子是基于esp32c3的IO口来连接的,如果使用其它的芯片需要根据实际来修改

在以下代码中需要根据实际来修改:

left_motor = DCMotor(in1_pin=1, in2_pin=0, reverse=False)   # 左电机 GPIO1, GPIO0
right_motor = DCMotor(in1_pin=2, in2_pin=3, reverse=True)   # 右电机 GPIO3, GPIO2
 

在这里面的IO口中,in1_pin和in2_pin交换又会有不同的效果。

在example目录下的web_control_motor.py中,可以通过连接esp32的热点来在网页中进行控制

注意:如果马达的转向与需求不符可尝试交换in1_pinin2_pin的值来修改马达的转向,以及如果没有添加stop函数来停止马达即使程序退出也不会停止

如果在使用中遇到一些问题可以通过提issues来获取解答

所有例子均可以单独运行

About

这是一个基于mircopython的mx1506驱动

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages