npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ezmotor

v1.0.0

Published

智能小车系列-动力系统

Downloads

2

Readme

ezMotor

智能小车系列-动力系统

项目使用麦克纳母轮。 支持小车向前、向后、向左、向右、向左前方、向右前方、向左后方、向右后方、向右旋转、向左旋转。

本库使用rpio,引脚使用物理引脚号。

本库在树莓派4B上进行测试。

本库使用 eztb6612 驱动轮子。

如果您使用其他型号的板子,可以替换为eztb6612。代码可参考eztb6612编写。

安装

npm install ezmotor eztb6612 ezpwmforraspberry --save

测试轮子及IO口

在使用轮子时,可能我们插线的时候,无法确认IO口连接的是哪个轮子,我们可以做简单的测试。

const MotorManager = require('./ezMotor.js');
const motorMgr = new MotorManager();
let motor = motorMgr.motorFactory(18, 22, ezPWM.PWMPin.PIN12);

motor.updateMotorSpeed(50); // 设定速度
motor.doForward();// 向前
motor.doForward();// 向后

使用

const ezPWM = require('ezpwmforraspberry');
const MotorManager = require('ezmotor');
const motorMgr = new MotorManager();

// 通过上面的 测试轮子及IO口, 我们基本可以确定引脚对应的轮子。
// 由于使用rpio库,我们默认使用物理引脚号作为输入。
this.rightFront = motorMgr.motorFactory(18, 22, ezPWM.PWMPin.PIN12); //右前轮
this.leftFront = motorMgr.motorFactory(31, 29, ezPWM.PWMPin.PIN12);  //左前轮
this.rightBack = motorMgr.motorFactory(15, 16, ezPWM.PWMPin.PIN12);  //右后轮
this.leftBack = motorMgr.motorFactory(13, 11, ezPWM.PWMPin.PIN12);   //左后轮

// 设置前后左右轮子
motorMgr.setupMotors(this.leftFront, this.rightFront, this.leftBack, this.rightBack); 

motorMgr.doForward(); // 向前
motorMgr.doBackward();// 向后
motorMgr.doLeft();// 向左
motorMgr.doRight();// 向右
motorMgr.turnLeft();// 向左旋转
motorMgr.turnRight();// 向右旋转
motorMgr.doRightFront();// 向右前方
motorMgr.doLeftFront();// 向左前方
motorMgr.doRightBack();// 向右后方
motorMgr.doLeftBack();// 向左后方

有技术问题可微信我

wechat