pixy2 smart camera library www.pixycam.com

Pixy2 Library project (using UART interface)

Revision:
15:c6e090cff722
Parent:
14:c0eda1e35a00
Child:
16:f84b0f970c3e
--- a/pixy2.h	Tue Mar 12 17:26:18 2019 +0000
+++ b/pixy2.h	Tue Mar 12 17:50:43 2019 +0000
@@ -473,9 +473,9 @@
 
 /**
  * This function gets the latest main features of Line tracking (including the Vector, any intersection that connects to the Vector, and barcodes).
+ * @note The main feature is the feature that is the most likely to be relevant for line traking.
+ * @note In case of multiple vector (for example 2 lines unconnected), the function will return only the vector of the line you are the most likely to follow.
  * The results are returned in the variables vectors, intersections, and barcodes, respectively.
- * The main feature is the feature that is the most likely to be the most relevant for line traking.
- * In case of multiple vector (for example 2 lines unconnected), the function will return only the vector of the line you are the most likely to follow.
  * @note General description : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:line_tracking
  * @note Frame Documentation : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:porting_guide
  * @note Function Documentation : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:pixy2_full_api#plugin_include__wiki__v2__line_api
@@ -496,7 +496,7 @@
  * @param feature (Byte - passed by value) : feature filtering 
  * @return T_pixy2ErrorCode : error code (if negative) or ORing of feature detected (if positive).
  * @note There are 3 possible features (vectors, intersections and barcodes).
- * @note Filtering or the feature detected are based on ORing codes : 1 for vectors, 2 for intersections, 4 for barcodes.
+ * @note Filtering or detected feature are based on ORing codes : 1 for vectors, 2 for intersections, 4 for barcodes.
  * @note So for filtering : 7 = accept all, 0 = reject all. For example filtering to get only vectors and barcode means using feature = 5 (1 + 4).
  * @note So for return value : 1 means only vector(s) detected, 2 means only intersection(s) detected, 3 vector(s) and intersection(s) detected and so on.
  */
@@ -507,15 +507,27 @@
  * @note General description : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:line_tracking
  * @note Frame Documentation : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:porting_guide
  * @note Function Documentation : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:pixy2_full_api#plugin_include__wiki__v2__line_api
- * @param mode (Byte - passed by value) : required feature 
+ * @param mode (Byte - passed by value) : ORing of required feature 
  * @return T_pixy2ErrorCode : error code.
- * @note There are 3 possible features (vectors, intersections and barcodes).
- * @note Filtering or the feature detected are based on ORing codes : 1 for vectors, 2 for intersections, 4 for barcodes.
- * @note So for filtering : 7 = accept all, 0 = reject all. For example filtering to get only vectors and barcode means using feature = 5 (1 + 4).
- * @note So for return value : 1 means only vector(s) detected, 2 means only intersection(s) detected, 3 vector(s) and intersection(s) detected and so on.
+ * @note There are 3 possible features :
+ * @note * LINE_MODE_TURN_DELAYED : Normally, the line tracking algorithm will choose the straightest path (branch) when encountering an intersection. Setting LINE_MODE_TURN_DELAYED will prevent the line tracking algorithm from choosing the path automatically. This is useful if your program doesn't know beforehand which path it wants to take at the next intersection.
+ * @note * LINE_MODE_MANUAL_SELECT_VECTOR : Normally, the line tracking algorithm will choose what it thinks is the best Vector line automatically. Setting LINE_MODE_MANUAL_SELECT_VECTOR will prevent the line tracking algorithm from choosing the Vector automatically. Instead, your program will need to set the Vector by calling setVector().
+ * @note * LINE_MODE_WHITE_LINE : Normally, the line tracking algorithm will try to find dark lines on a light background (black lines). Setting LINE_MODE_WHITE_LINE will instruct the line tracking algorithm to look for light lines on a dark background (white lines).
  */
 T_pixy2ErrorCode pixy2_setMode (Byte mode);
-T_pixy2ErrorCode pixy2_setNexTurn (Word angle);
+
+/**
+ * This function tells the line tracking algorithm which path it should take at the next intersection.
+ * @note General description : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:line_tracking
+ * @note Frame Documentation : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:porting_guide
+ * @note Function Documentation : https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:pixy2_full_api#plugin_include__wiki__v2__line_api
+ * @param angle (sWord - passed by value) : angle closest to the next turn (in degree, between -180 and 180) 
+ * @return T_pixy2ErrorCode : error code.
+ * @note Turn angles are specified in degrees, with 0 being straight ahead, left being 90 and right being -90 (for example), although any valid angle value can be used. Valid angles are between -180 and 180.
+ * @note setNextTurn() will remember the turn angle you give it, and execute it at the next intersection. The line tracking algorithm will then go back to the default turn angle for subsequent intersections.
+ * @note Upon encountering an intersection, the line tracking algorithm will find the path in the intersection that matches the turn angle most closely. 
+ */
+T_pixy2ErrorCode pixy2_setNexTurn (sWord angle);
 T_pixy2ErrorCode pixy2_setDefaultTurn (Word angle);
 T_pixy2ErrorCode pixy2_setVector (Byte vectorIndex);
 T_pixy2ErrorCode pixy2_ReverseVector (void);