Class: Buzz

neosensory.Buzz(ondata)

new Buzz(ondata)

A class to manage connections to the Neosensory Buzz
Parameters:
Name Type Description
ondata callback Callback function to handle app logic
Source:

Methods

(static) acceptTerms()

Accept developer terms of the Neosensory Developer API License (https://neosensory.com/legal/dev-terms-service) after calling requestAuthorization(). Successfully calling this unlocks the following commands: audio start, audio stop, motors_clear_queue, motors start, motors_stop, motors vibrate.
Source:

(static) battery()

Request the current battery level from the device.
Source:

(static) clearMotorQueue()

Clear any vibration commands sitting the device’s motor FIFO queue. This should be called prior to streaming control frames using vibrateMotors. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) connect()

Setup BLE interface.
Source:

(static) disableMotors()

Clear the motors command queue and shut down the motor drivers. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) disconnect()

Disconnect the device.
Source:

(static) enableMotors()

Initialize and start the motors interface. The motors can then accept motors vibrate commands. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) getLEDs()

Read the current RGB and intensity calues of the device's LEDs. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) getLRA()

This command allows you to read the current LRA vibration mode. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) getThreshold()

Return the current vibrateMotors() command queue configuration. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) info()

Obtain device and firmware information.
Source:

(static) parseResponse(response)

Parse JSON response from the device.
Parameters:
Name Type Description
response utf8 UTF-8 byte array.
Source:

(static) pauseDeviceAlgorithm()

Pause the default Neosensory algorithm on the device to accept developer commands. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) requestAuthorization()

Request developer authorization (https://neosensory.com/legal/dev-terms-service)
Source:

(static) resumeDeviceAlgorithm()

Restart the default Neosensory algorithm. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) sendCommand()

A function to encode command strings and send to the device
Source:

(static) setButton(feedback, sensitivity)

Set button response and sensitivity. Requires users to requestAuthorization() and acceptTerms().
Parameters:
Name Type Description
feedback boolean Allow the device to send a response when any button is pressed.
sensitivity boolean Allow sensitivity changes to the microphone.
Source:

(static) setLEDs(colors, intensities)

Control the color and intensity of the device's 3 LEDs. Requires users to requestAuthorization() and acceptTerms().
Parameters:
Name Type Description
colors array Three nested arrays each containing the rgb values (0-255) for an LED.
intensities array An array of length 3 containing the LED intensity (0-50).
Source:
Example
buzz.setLEDS([[255,0,0],[0,255,0],[0,0,255]],[50,50,50])

(static) setLRA()

This command sets the LRA operation mode. This setting is not persistent, and will reset to the default (open loop) if the band is reset. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) setThreshold(feedbackType, threshold)

Configure how the device responds to the vibrateMotors() command. Requires users to requestAuthorization() and acceptTerms().
Parameters:
Name Type Description
feedbackType string Integer between 0-2. 0 = Default; 1 = Always Respond; 2 = Threshold Response.
threshold float Float between 0 - 64.
Source:

(static) startAudio()

Starts the device’s microphone audio acquisition. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) stopAudio()

Stops the device’s microphone audio acquisition. Requires users to requestAuthorization() and acceptTerms().
Source:

(static) vibrateMotors(controlFrames)

Set the actuators amplitudes on a connected Neosensory device. Requires users to requestAuthorization() and acceptTerms().
Parameters:
Name Type Description
controlFrames array Nested arrays with a length matching the number of motors of the target device (Buzz: 4). Element values should between 0 and 255.
Source:
Example
buzz.vibrateMotors([[155,0,0,0]])