You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

monster-drift

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monster-drift

Drive a remote controlled drift car with Node.js and HackRF

Source
npmnpm
Version
0.4.0
Version published
Maintainers
2
Created
Source

monster-drift

📻🏎 Drive a remote controlled drift car with Node.js and HackRF. This is beta software.

Build status js-standard-style

180 turn

Contributions

Contributions are welcome! Add your own tricks and manoeuvres and make a Pull Request 🤕🙈✌️

Installation

npm install monster-drift --save

Usage

Drive forward for one seconds and stop:

var drive = require('monster-drift')()

drive.forward()

setTimeout(function () {
  drive.stop()
}, 1000)

API

var drive = new MonsterDrift([options])

This module exposes a MonsterDrift object that you can initiate to get a drive object.

Options:

  • stop - Milliseconds in which to automatically stop the card if no drive commands have been issued (default: never)
  • freq - The frequency in Hz (default: 27MHz)
  • id - The HackRF device id to use (default: 0)
  • gain - The HackRF TX gain (default: 40)

drive.forward()

Drive forward.

drive.backward()

Drive backward.

drive.left()

Turn wheels left.

drive.right()

Turn wheels right.

drive.forwardRight()

Drive forward and right.

drive.forwardLeft()

Drive forward and left.

drive.backwardRight()

Drive backward and turn right.

drive.backwardLeft()

Drive backward and turn left.

drive.stop([callback])

Stop the car and turn off transmitter. Calls optional callback when done.

drive.close([callback])

Stop the car, turn off transmitter and close the HackRF USB connection. Calls optional callback when done.

drive.turn180([callback])

Make a 180. Calls callback when done.

drive.batch(commands[, callback])

Issue a series of driving commands to the car and call optional callback when done.

The commands argument is an array of commands. Each command is a double tuple with the following format: [function, duration]. The function part is a drive function, e.g. drive.forward, and the duration part is the number of milliseconds to perform the operation.

If the last tuple contains a duration then drive.stop will be called automatically. Leave out duratuon to continue forever.

// make a 180
drive.batch([
  [drive.forward, 1000],
  [drive.right, 125],
  [drive.backwardLeft, 100],
  [drive.backward]
])

License

MIT

Keywords

hackrf

FAQs

Package last updated on 21 Jan 2017

Did you know?

Socket

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.

Install

Related posts