You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New link types can be easily added by implementing Link
7
7
8
-
[Original Pixy2 Code for C++ Arduino](https://github.com/charmedlabs/pixy2/tree/master/src/host/arduino/libraries/Pixy2)
8
+
[Original Pixy2 Code for C++ Arduino](https://github.com/charmedlabs/pixy2/tree/master/src/host/arduino/libraries/Pixy2)
9
+
10
+
---
11
+
## Installing the API
12
+
To install the API, it can either be downloaded and copied directly into the project, or you can use it with Gradle/Maven.
13
+
14
+
The maven repository is located at: https://nexus.otake.pw/repository/maven-public/ The group id is `pw.otake.pseudoresonance` and the artifact name is `pixy2-java-api` For FRC Gradle builds, this can be easily added by adding the following to `build.gradle` in the project's root.
15
+
16
+
Add `maven { url 'https://nexus.otake.pw/repository/maven-public/' }` under `repositories`
17
+
18
+
Add `compile 'pw.otake.pseudoresonance:pixy2-java-api:1.0'` under `dependencies`
First create a Pixy2 camera object with `Pixy2 pixy = Pixy2.createInstance(link)` and supply the link type of your choosing. Next, initialize the Pixy2 camera with `pixy.init(arg)`. You can either omit arg, your add a value based on the link type.
44
+
45
+
The Pixy2 can now be called on with the various provided methods as outlined in the documentation and on the Pixy2 website.
46
+
47
+
---
48
+
## Connecting Pixy2 to RoboRIO
49
+
SPI is the recommended link type due to it's higher data transfer rate as well as better implementation in the WPILib API which helps with efficiency.
50
+
51
+
### SPI
52
+
| Pixy2 Port | RoboRIO Port |
53
+
| --- | --- |
54
+
| 1 | MISO |
55
+
| 2 | 5V |
56
+
| 3 | SCLK |
57
+
| 4 | MOSI |
58
+
| 6 | ⏚ Ground |
59
+
| 7 | CS0 (Optional) |
60
+
61
+
**NOTE**: Pin 7/CS0 pin is the optional SPI Slave Select (SS) pin. It can be connected to any SS pin on the RoboRIO, CS0, CS1, CS2 or CS3. If slave select functionality is not needed, set the Pixy2 to use the data output `Arduino ICSP SPI`. Use `SPI with SS` for slave select support. In the code, the slave pin in use can be selected by using an initialization argument of the corresponding pin. 0 for CS0, 1 for CS1, et
62
+
63
+
### I2C
64
+
| Pixy2 Port | RoboRIO Port |
65
+
| --- | --- |
66
+
| 2 | 5V (from VRM) |
67
+
| 5 | SCL |
68
+
| 6 | ⏚ Ground |
69
+
| 9 | SDA |
70
+
71
+
**NOTE**: The RoboRIO does not have a 5V output for I2C, and thus, the 5V must be sourced elsewhere, such as from the VRM.
72
+
73
+
### UART/Serial/RS-232
74
+
| Pixy2 Port | RoboRIO Port |
75
+
| --- | --- |
76
+
| 1 | RXD |
77
+
| 2 | 5V (from VRM) |
78
+
| 4 | TXD |
79
+
| 6 | ⏚ Ground |
80
+
81
+
**NOTE**: The RoboRIO does not have a 5V output for UART/Serial/RS-232, and thus, the 5V must be sourced elsewhere, such as from the VRM.
0 commit comments