
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
A JavaScript library allowing the raspberry pi to control VEX motors via the Adafruit Servo/PWM HAT!
A JavaScript library allowing the Raspberry Pi to control VEX motors via the Adafruit Servo/PWM HAT!
Let's say we made a simple robot with two motors, one motor controlling the right side of the wheels, and one motor controlling the left side. This code would make the robot go foward at full speed for 5 seconds before stopping. In this example, pin 0 refers to the right motor and pin 1 to the left motor.
const { Vex4Pi } = require('vex4pi');
const { sleep } = require('sleep');
let robot = new Vex4Pi();
// initialize the pins on the robot
robot.init();
// make the robot go full speed ahead
robot.setSpeed(0, 100);
robot.setSpeed(1, -100);
// wait for 5 seconds
sleep(5);
// stop the robot
robot.setSpeed(0, 0);
robot.setSpeed(1, 0);
// free up the pins
robot.deinit();
/*
* Initializes the connection to the PWM/Servo HAT at address `0x40` at `/dev/i2c-1`, and
* resets all of the pin speed values to 0.
*/
Vex4Pi.init();
/*
* Resets all of the pin speed values to 0 before gracefully closing the connection with
* the PWM/Servo HAT.
*/
Vex4Pi.deinit();
/*
* Sets the `speed` of a motor at the designated `pin` value. Note that the accepted speed
* values are between -100 and 100, and any value outside that range will be confined into
* that range (ex. -150 => -100 or 420 => 100). If the init() function has not been called
* before, or the pin value is not an integer/out of range, this module will throw an error.
*/
Vex4Pi.setSpeed(Integer pin, Integer speed);
1.0.1 (July/9/2019)
FAQs
A JavaScript library allowing the raspberry pi to control VEX motors via the Adafruit Servo/PWM HAT!
The npm package vex4pi receives a total of 2 weekly downloads. As such, vex4pi popularity was classified as not popular.
We found that vex4pi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.