This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
wiki:v2:general_api [2018/05/22 14:47] pixycam |
wiki:v2:general_api [2018/05/22 15:31] pixycam |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Pixy2 General API ===== | ===== Pixy2 General API ===== | ||
+ | |||
+ | Pixy2's general API can be called through the base Pixy2 object, for example: | ||
+ | |||
+ | <code> | ||
+ | Pixy2 pixy; | ||
+ | |||
+ | pixy.init(); // call init() member function | ||
+ | </code> | ||
==== Member functions ==== | ==== Member functions ==== | ||
| | ||
- | === int8_t init(uint32_t arg[optional]) === | + | === int8_t init(uint32_t arg [optional]) === |
init() should be called before your program communicates with Pixy. init() returns an [[wiki:v2:general_api#Error codes|error value]] (<0) if it fails and 0 (PIXY\_RESULT\_OK) if it succeeds. | init() should be called before your program communicates with Pixy. init() returns an [[wiki:v2:general_api#Error codes|error value]] (<0) if it fails and 0 (PIXY\_RESULT\_OK) if it succeeds. | ||
Line 79: | Line 87: | ||
=== PIXY_RESULT_BUSY === | === PIXY_RESULT_BUSY === | ||
- | This is returned when Pixy has no new data. It is used for polling mode, not blocking. | + | This is returned when Pixy has no new data. It is used in polling mode, as opposed to blocking mode. |
=== PIXY_RESULT_CHECKSUM_ERROR === | === PIXY_RESULT_CHECKSUM_ERROR === |