Mechatronics Robotics
/
BrobotV1
These are the core files for the Robot at Team conception.
Pixy.h@17:ec52258b9472, 2017-06-07 (annotated)
- Committer:
- obrie829
- Date:
- Wed Jun 07 11:35:59 2017 +0000
- Revision:
- 17:ec52258b9472
- Parent:
- 1:ff0674b96cc5
v18
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
obrie829 | 0:eba74e7a229b | 1 | #include <mbed.h> |
obrie829 | 1:ff0674b96cc5 | 2 | |
obrie829 | 0:eba74e7a229b | 3 | class Pixy |
obrie829 | 0:eba74e7a229b | 4 | { |
obrie829 | 0:eba74e7a229b | 5 | public: |
obrie829 | 0:eba74e7a229b | 6 | Pixy(Serial& cam); |
obrie829 | 1:ff0674b96cc5 | 7 | |
obrie829 | 0:eba74e7a229b | 8 | struct pixy_s { |
obrie829 | 0:eba74e7a229b | 9 | uint16_t checksum; |
obrie829 | 0:eba74e7a229b | 10 | uint16_t signature; |
obrie829 | 0:eba74e7a229b | 11 | uint16_t x; |
obrie829 | 0:eba74e7a229b | 12 | uint16_t y; |
obrie829 | 0:eba74e7a229b | 13 | uint16_t width; |
obrie829 | 0:eba74e7a229b | 14 | uint16_t height; |
obrie829 | 0:eba74e7a229b | 15 | }; |
obrie829 | 1:ff0674b96cc5 | 16 | |
obrie829 | 0:eba74e7a229b | 17 | int getX(); |
obrie829 | 0:eba74e7a229b | 18 | int getY(); |
obrie829 | 0:eba74e7a229b | 19 | int getSignature(); |
obrie829 | 1:ff0674b96cc5 | 20 | int getHeight(); |
obrie829 | 1:ff0674b96cc5 | 21 | int getWidth(); |
obrie829 | 1:ff0674b96cc5 | 22 | bool objectDetected(); |
obrie829 | 1:ff0674b96cc5 | 23 | |
obrie829 | 0:eba74e7a229b | 24 | private: |
obrie829 | 1:ff0674b96cc5 | 25 | void rxCallback(); |
obrie829 | 1:ff0674b96cc5 | 26 | |
obrie829 | 0:eba74e7a229b | 27 | bool startFound; |
obrie829 | 1:ff0674b96cc5 | 28 | int detects; |
obrie829 | 1:ff0674b96cc5 | 29 | |
obrie829 | 0:eba74e7a229b | 30 | Serial& cam; |
obrie829 | 0:eba74e7a229b | 31 | pixy_s pixy; |
obrie829 | 0:eba74e7a229b | 32 | }; |