Changes

Jump to navigation Jump to search
2,441 bytes added ,  01:19, 23 June 2017
Line 256: Line 256:  
</code><br />
 
</code><br />
 
This method attaches a generic handler, which will call gestGeneralHandler(struct gesture gest) -- a callback that you must implement in your code, whenever '''any''' gesture is identified targeting your board, whether it is a request, response, or broadcast gesture.
 
This method attaches a generic handler, which will call gestGeneralHandler(struct gesture gest) -- a callback that you must implement in your code, whenever '''any''' gesture is identified targeting your board, whether it is a request, response, or broadcast gesture.
 +
 +
=== State Functions ===
 +
State Functions are a set of functions deemed very standardized and useful to all boards that describe the state of the payload, as reported by the avionics. These functions allow boards to very easily request simple data from the avionics, without setting up and transmitting a gesture -- the entire gesture is created, send, and interpreted by STINGR, which simply returns the desired information.
 +
 +
<code>
 +
int alt = myStingr.getAltitude();
 +
</code><br />
 +
Returns integer altitude, in meters, as indicated by the Core Avionics.
 +
 +
<code>
 +
int alt = myStingr.getPressureAltitude();
 +
</code><br />
 +
Returns integer altitude, only based on barometric pressure, in meters, as indicated by the Core Avionics.
 +
 +
<code>
 +
int alt = myStingr.getGPSAltitude();
 +
</code><br />
 +
Returns integer GPS altitude, in meters, as indicated by the Core Avionics.
 +
 +
<code>
 +
double alt = myStingr.getBarometricPressure();
 +
</code><br />
 +
Returns double pressure, in Pa, as indicated by the Core Avionics.
 +
 +
<code>
 +
double lat = myStingr.getLatitude();
 +
</code><br />
 +
Returns double GPS latitude as indicated by the Core Avionics.
 +
 +
<code>
 +
double long = myStingr.getLongitude();
 +
</code><br />
 +
Returns double GPS longitude as indicated by the Core Avionics.
 +
 +
<code>
 +
double tmp = myStingr.getInternalTemp();
 +
</code><br />
 +
Returns double internal temperature, in degrees celsius, as indicated by the Core Avionics.
 +
 +
<code>
 +
double tmp = myStingr.getExternalTemp();
 +
</code><br />
 +
Returns double external temperature, in degrees celsius, as indicated by the Core Avionics.
 +
 +
<code>
 +
int stabIndex = myStingr.getStabilityIndex();
 +
</code><br />
 +
Returns integer stability index, from 0-100, as determined by the Core Avionics.
 +
 +
<code>
 +
byte state = myStingr.getFlightState();
 +
</code><br />
 +
Returns flight state (0 - Ground, 1 - Ascent, 2 - Descent by Pop, 3 - Descent by Cutdown, 4 - Land), as indicated by the Core Avionics.
 +
 +
<code>
 +
int stabIndex = myStingr.getAscentRate();
 +
</code><br />
 +
Returns ascent rate, in meters per second, as determined by the Core Avionics.
 +
 +
<code>
 +
float volt = myStingr.getVoltage();
 +
</code><br />
 +
Returns battery pack voltage, in volts, as determined by the Core Avionics.
 +
 +
<code>
 +
float volt = myStingr.getCurrent();
 +
</code><br />
 +
Returns flight stack current draw, in mA, as determined by the Core BMS.
 +
 +
<code>
 +
float capacity = myStingr.getCapacity();
 +
</code><br />
 +
Returns battery pack capacity (0-1000), as determined by the Core BMS.

Navigation menu