libmanta
A cross-platform API for the Snyderphonics Manta
Public Member Functions
Manta Class Reference

Superclass that provides an interface to the Manta. More...

#include <Manta.h>

Inheritance diagram for Manta:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Manta (void)
 Manta constructor.
virtual void SetPadLED (LEDState state, int ledID)
 Sets a single LED.
virtual void SetPadLEDRow (LEDState state, int row, uint8_t mask)
 Sets a row of LEDs.
virtual void SetPadLEDColumn (LEDState state, int column, uint8_t mask)
 Sets a column of LEDs.
virtual void SetPadLEDFrame (LEDState state, uint8_t mask[])
 Sets all the pad LEDs at the same time.
virtual void SetSliderLED (LEDState state, int id, uint8_t mask)
 Sets the slider LEDs.
virtual void SetButtonLED (LEDState state, int id)
 Sets a button LED.
virtual void ResendLEDState (void)
 Resends the currently-stored LED State.
virtual void ClearPadAndButtonLEDs (void)
 Sets all the Pad and Button LEDs to Off.
virtual void ClearButtonLEDs (void)
 Sets all the Button LEDs to Off.
virtual void Recalibrate (void)
 Toggles the Recalibrate bit on the Manta.
virtual void SetLEDControl (LEDControlType control, bool state)
 Sets the current LED Control mode.
virtual void SetTurboMode (bool Enabled)
 Enables or Disables Turbo Mode.
virtual void SetRawMode (bool Enabled)
 Enables or Disables Raw Mode.
virtual void SetMaxSensorValues (int *values)
 Sets the maximum sensor values used for scaling.

Detailed Description

Superclass that provides an interface to the Manta.

The Manta class is intended to use as a base class within your application. In order to use libmanta, subclass this and define implementations for any callback functions that you would like your application to be notified of. The event functions are declared in the MantaClient interface.

Creating an instance of the Manta class (or a subclass) will not initiate a connection to any plugged-in mantas. Before you can start communicating with the Manta you must call its Connect() method to connect to a physical Manta over USB.

Once connected, your application should periodically call the static method HandleEvents(). This will take care of servicing the low-level USB communication for all connected Mantas.

Definition at line 26 of file Manta.h.


Constructor & Destructor Documentation

Manta::Manta ( void  )

Manta constructor.

The Constructor for the Manta class just initializes internal data

Definition at line 11 of file Manta.cpp.


Member Function Documentation

void Manta::SetButtonLED ( LEDState  state,
int  id 
) [virtual]

Sets a button LED.

Parameters:
stateOff, Amber, or Red.
idID of the button LED you'd like to set

Implements MantaServer.

Definition at line 315 of file Manta.cpp.

void Manta::SetLEDControl ( LEDControlType  control,
bool  state 
) [virtual]

Sets the current LED Control mode.

Parameters:
controlWhich control set will be toggled
statefalse for disabled, true for enabled

LEDs on the Manta can either be controlled automatically by the Manta itself in response to touch, or driven my messages by the host. This method determines how the LEDs are controlled in the Manta. Setting a zone of LEDs to Enabled causes them to be controlled by the host, and Disabled will hand control to the Manta.

Implements MantaServer.

Definition at line 417 of file Manta.cpp.

void Manta::SetMaxSensorValues ( int *  values) [virtual]

Sets the maximum sensor values used for scaling.

Parameters:
valuesarray of 52 ints to set new scaling values

libmanta scales the incoming values from the Manta to equalize the sensitivity of the pads. Without this scaling, some pads tend to be more or less sensitive depending on their location, and manufacturing variations.

libmanta comes with built-in scaling factors that should be suitable for most Mantas, but this method allows your application to tune those scaling factors to an individual user's Manta. After scaling, the pads each should output a number from 0 - 210.

To calibrate a Manta

  • Build an array of 52 ints and set them all to 210
  • Call SetMaxSensorValues() with your array set to 210 to disable scaling
  • Instruct the user to press each pad with their full thumb and record the maximum values in your array
  • call SetMaxSensorValues() with the new array

Implements MantaServer.

Definition at line 509 of file Manta.cpp.

void Manta::SetPadLED ( LEDState  state,
int  ledID 
) [virtual]

Sets a single LED.

Parameters:
stateOff, Amber, or Red
ledIDThe ID of the LED to be set (0 - 47)

Implements MantaServer.

Definition at line 104 of file Manta.cpp.

void Manta::SetPadLEDColumn ( LEDState  state,
int  column,
uint8_t  mask 
) [virtual]

Sets a column of LEDs.

Parameters:
stateOff, Amber, or Red. All LEDs with their bit set to one in the mask will be set to this state
columnThe column index, starting with 0 on the left
maskA mask representing the column. The lsb is the bottom LED

Implements MantaServer.

Definition at line 185 of file Manta.cpp.

void Manta::SetPadLEDFrame ( LEDState  state,
uint8_t  mask[] 
) [virtual]

Sets all the pad LEDs at the same time.

Parameters:
stateOff, Amber, or Red. All LEDs with their bit set to one in the mask will be set to this state
maskA 6-byte mask representing all the pads. The first byte is the bottom row, and the lsb is the leftmost LED

Implements MantaServer.

Definition at line 243 of file Manta.cpp.

void Manta::SetPadLEDRow ( LEDState  state,
int  row,
uint8_t  mask 
) [virtual]

Sets a row of LEDs.

Parameters:
stateOff, Amber, or Red. All LEDs with their bit set to one in the mask will be set to this state
rowThe row index, starting with 0 at the bottom
maskA mask representing the row. The lsb is the rightmost LED

Implements MantaServer.

Definition at line 145 of file Manta.cpp.

void Manta::SetRawMode ( bool  Enabled) [virtual]

Enables or Disables Raw Mode.

Parameters:
Enabledfalse for disabled, true for enabled

Normally the Manta does some pre-processing of its output to remove low-level noise from the sensors. By enabling Raw mode you can bypass the filtering to get the raw values delivered by the sensor. This causes lots of noise on individual pads, but is sometimes useful in conjunction with centroid detection.

Implements MantaServer.

Definition at line 477 of file Manta.cpp.

void Manta::SetSliderLED ( LEDState  state,
int  id,
uint8_t  mask 
) [virtual]

Sets the slider LEDs.

Parameters:
stateOff, Amber, or Red. All LEDs with their bit set to one in the mask will be set to this state
id0 for the bottom slider, 1 for the top slider
maskA mask representing the slider. The lsb is the rightmost LED

Implements MantaServer.

Definition at line 284 of file Manta.cpp.

void Manta::SetTurboMode ( bool  Enabled) [virtual]

Enables or Disables Turbo Mode.

Parameters:
Enabledfalse for disabled, true for enabled

TBD - need to ask Jeff exactly how Turbo Mode works

Implements MantaServer.

Definition at line 455 of file Manta.cpp.


The documentation for this class was generated from the following files: