pixy Libari 2
Dependents: PES PES1 PES4 PES3
Diff: Pixy.h
- Revision:
- 1:a57585d5e81b
- Parent:
- 0:ed8dc4531ac1
diff -r ed8dc4531ac1 -r a57585d5e81b Pixy.h --- a/Pixy.h Sun Nov 16 11:52:55 2014 +0000 +++ b/Pixy.h Wed Mar 29 12:34:18 2017 +0000 @@ -1,13 +1,11 @@ -#ifndef TUIASI_PIXY_H -#define TUIASI_PIXY_H +#ifndef PIXY_H +#define PIXY_H #include "mbed.h" -#include "PixyLinkSPI.h" #include "PixyLinkI2C.h" -#include "PixyLinkUART.h" struct Block { - void print(Serial &pc) { + void print(Serial &pc) { pc.printf("sig: %d x: %d y: %d width: %d height: %d\n", signature, x, y, width, height); }; uint16_t signature; @@ -20,8 +18,7 @@ class Pixy { public: - enum LinkType {SPI, I2C, UART}; - Pixy(LinkType linkType, PinName mosi_sda_tx, PinName miso_scl_rx, PinName sclk = NC); + Pixy(PinName mosi_sda_tx, PinName miso_scl_rx); ~Pixy(); uint16_t getBlocks(uint16_t maxBlocks=1000); int8_t setServos(uint16_t s0, uint16_t s1); @@ -35,7 +32,7 @@ static const uint8_t PIXY_MAXIMUM_ARRAYSIZE = 130; static const uint16_t PIXY_START_WORD = 0xaa55; static const uint16_t PIXY_START_WORDX = 0x55aa; - static const uint8_t PIXY_DEFAULT_ADDR = 0x54; // I2C + static const uint8_t PIXY_DEFAULT_ADDR = 0xAC; // I2C Adresse bool getStart(); void resize(); @@ -47,4 +44,4 @@ PixyLink *m_link; Serial *pc; }; -#endif //TUIASI_PIXY_H \ No newline at end of file +#endif //PIXY_H \ No newline at end of file