0.0.5 • Published 4 years ago
owi-edge v0.0.5
OWI Edge
Programmatically control your robot arm and rule the world!
This driver assumes you are using the OWI-535 Robotic Arm Edge with USB Interface.
Install
Tested using Node 6 and 8
npm install owi-edge --save
# or yarn
yarn add owi-edge
This uses the usb npm package which uses libusb
so you will need to build the usb drivers for your operating system. See the usb npm package for more details.
Usage
const Arm = require('owi-edge');
const arm = new Arm();
// Turn LED on and open hand at the same time
arm.turnLedOn();
arm.openHand();
arm.stopAll(); // or arm.stopHand(); arm.turnLedOff();
Examples
# after installing this package
cd node_modules/owi-edge
npm run dance
Supported Commands
// LED
arm.turnLedOn();
arm.turnLedOff();
// Hand
arm.stopHand();
arm.openHand();
arm.closeHand();
// Wrist
arm.stopWrist();
arm.moveWristUp();
arm.moveWristDown();
// Elbow
arm.stopElbow();
arm.moveElbowUp();
arm.moveElbowDown();
// Shoulder
arm.stopShoulder();
arm.moveShoulderUp();
arm.moveShoulderDown();
// Base
arm.stopBase();
arm.moveBaseClockwise();
arm.moveBaseCounterClockwise();
// Stop all body parts
arm.stopAll();
How it works
The USB interface reads 3 bytes for commands. Each byte corresponds to a part of the robot arm.
- Setting a bit to 1 tells a body part to move.
- Setting a bit to 0 tells that body part to stop.
- Setting multiple bits to 1 allows multiple body parts to move.
Run tests
npm test
Development
git clone https://github.com/lexlacson/owi-edge.git
npm install
npm test
npm run dance # with owi arm edge usb connected to computer
Author
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgements
Special thanks to this article for explaining how the USB interface works.