README
dream-cheeky-thunder-driver
Nodejs API for controller dream cheeky missile launcher. This is a reinforcement of jackkwong's dream-cheeky-api library, which handle led.
Installation
npm install dream-cheeky-thunder-driver
- In your js file, add
var DCDriver = require('dream-cheeky-thunder-driver');
API
DCDriver
DCDriver.DEVICE_CONSTANTS
Description:
A JS object containing constants for Dream Cheeky Thunder Launcher.
DCDriver.turnOnDebugMode()
Description:
Turn on debug mode (level 4) of USB.
DCDriver.turnOffDebugMode()
Description:
Turn off USB debug mode (ie. debug level 0).
durationMS
[, callback
])
DCDriver.moveUp(Description:
Move up for a period of time.
Parameters:
durationMS
Type: Number
Duration of moving time in ms.
callback
Type: Function()
A function to execute when the movement is done.
durationMS
[, callback
])
DCDriver.moveDown(Description:
Move down for a period of time.
Parameters:
durationMS
Type: Number
Duration of moving time in ms.
callback
Type: Function()
A function to execute when the movement is done.
durationMS
[, callback
])
DCDriver.moveLeft(Description:
Move left for a period of time.
Parameters:
durationMS
Type: Number
Duration of moving time in ms.
callback
Type: Function()
A function to execute when the movement is done.
durationMS
[, callback
])
DCDriver.moveRight(Description:
Move right for a period of time.
Parameters:
durationMS
Type: Number
Duration of moving time in ms.
callback
Type: Function()
A function to execute when the movement is done.
callback
])
DCDriver.stop([Stop movement immediately.
Parameters:
callback
Type: Function()
A function to execute when the movement is stopped.
numberOfShot
[, callback
])
DCDriver.fire(Shoot for numberOfShot
times consecutively.
Parameters:
numberOfShot
Type: Number
Number of shots
callback
Type: Function()
A function to execute when all the shooting is done (and when the target is utterly destroyed!).
callback
])
DCDriver.park([Go back to a fixed default location (leftmost and bottommost position).
Parameters:
callback
Type: Function()
A function to execute when all the movement is done.
commands
[, callback
])
DCDriver.execute(NOT STABLE yet, will be improved.
Convenient method to specify a chain of commands
Parameters:
commands
Type: String
callback
Type: Function()
A function to execute when the chain of commands is done.
commands
[, callback
])
DCDriver.led(Activate the led on th device
Parameters:
commands
Type: String
callback
Type: Function()
A function to execute when done.