A library for interfacing with the Pixy color recognition camera
Dependents: PixyCamera MbedOS_Robot_Team ManualControlFinal PlayBack ... more
PixySPI Class Reference
The SPI Pixy interface for the Pixy camera. More...
#include <Pixy.h>
Inherits TPixy< PixyInterfaceSPI >.
Public Member Functions | |
PixySPI (SPI *spi, Serial *serialOut=NULL, uint16_t arg=PIXY_DEFAULT_ARGVAL) | |
Constructor for the PixySPI class Instantiates a Pixy object that communicates via an SPI connection. | |
void | printBlock (Block &block) |
Prints the given Block out to the given serial port. | |
uint16_t | getBlocks (uint16_t maxBlocks=1000) |
Returns the number of Blocks found in the current view and updates all Blocks' info. | |
int8_t | setServos (uint16_t s0, uint16_t s1) |
Sets the PWM value of the Pixy servos. | |
int8_t | setBrightness (uint8_t brightness) |
Sets the brightness of the Pixy RGB LED. | |
int8_t | setLED (uint8_t r, uint8_t g, uint8_t b) |
Sets the color of the Pixy RGB LED. | |
void | init () |
Initializes the Pixy. |
Detailed Description
The SPI Pixy interface for the Pixy camera.
#include "Pixy.h" Serial serial(USBTX, USBRX); SPI spi(p5, p6, p7); PixySPI pixy(&spi, &serial); int main() { runPanTiltDemo(); }
Definition at line 23 of file Pixy.h.
Constructor & Destructor Documentation
PixySPI | ( | SPI * | spi, |
Serial * | serialOut = NULL , |
||
uint16_t | arg = PIXY_DEFAULT_ARGVAL |
||
) |
Constructor for the PixySPI class Instantiates a Pixy object that communicates via an SPI connection.
- Parameters:
-
SPI* spi the pointer to the SPI connection Serial* serialOut the optional serial output pointer to print out Pixy camera data int arg an optional integer argument used for custom implementations of the Pixy library
Member Function Documentation
uint16_t getBlocks | ( | uint16_t | maxBlocks = 1000 ) |
[inherited] |
Returns the number of Blocks found in the current view and updates all Blocks' info.
- Parameters:
-
maxBlocks the maximum number of Blocks to search for
- Returns:
- the number of Blocks found
void init | ( | ) | [inherited] |
Initializes the Pixy.
void printBlock | ( | Block & | block ) | [inherited] |
int8_t setBrightness | ( | uint8_t | brightness ) | [inherited] |
Sets the brightness of the Pixy RGB LED.
- Parameters:
-
brightness the brightness of the LED
- Returns:
- the interface return value for sending the brightness command
int8_t setLED | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b | ||
) | [inherited] |
Sets the color of the Pixy RGB LED.
- Parameters:
-
r the red color value g the green color value b the blue color value
int8_t setServos | ( | uint16_t | s0, |
uint16_t | s1 | ||
) | [inherited] |
Sets the PWM value of the Pixy servos.
- Parameters:
-
s0 the value of the left servo s1 the value of the right servo
- Returns:
- the interface return value for sending the servo command
Generated on Tue Jul 12 2022 18:15:33 by 1.7.2