|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Quick fix for getting serial data from CMUcam5 Pixy
Can you make the Labview code downloadable please. Thanks. Also, I'm assuming you are running that in Periodic tasks on the roborio right? I'm also extremely new to labview.
|
|
#2
|
||||
|
||||
|
Re: Quick fix for getting serial data from CMUcam5 Pixy
Quote:
And yes this belongs in periodic tasks. |
|
#3
|
|||
|
|||
|
Re: Quick fix for getting serial data from CMUcam5 Pixy
Quote:
|
|
#4
|
||||
|
||||
|
Re: Quick fix for getting serial data from CMUcam5 Pixy
Quote:
|
|
#5
|
||||
|
||||
|
Re: Quick fix for getting serial data from CMUcam5 Pixy
There isn't anything related to serial communication in the begin VI. In this case having the initialization code outside of and feeding the loop is effectively the same as having it in the begin VI. The only difference is that code in the begin VI executes before code in periodic tasks. There is also no need for a Refnum set/get VI.
The begin VI exists to help organize code that only needs to execute once and at the beginning of the program, and to ensure that code that initializes something executes before that thing is called in other VIs like periodic tasks or teleop. |
|
#6
|
||||
|
||||
|
Re: Quick fix for getting serial data from CMUcam5 Pixy
This has been turned into a git hub repo here: https://github.com/FRC4080Turner/Pixy-cam-to-RoboRIO. I will be updating it tomorrow and over the weekend after I have tested this on the RIO again. I will also be testing the Pixy with this lens: http://www.ebay.com/itm/122198892672 and its standard lens on 2016 reflective tape targets.
|
|
#7
|
||||
|
||||
|
Re: Quick fix for getting serial data from CMUcam5 Pixy
So far the Pixy has done a pretty good job of finding reflective tape lit with green LED rings in a well lit area.
Right now I am having an odd problem with the RIO talking to the arduino. Whenever I run the labview code on my computer it works as intended but when I run it on the RIO it seems the RIO is writing to the serial port several times every time I tell it to write once. I double checked with the arduino sketch below and it seems to confirm that the RIO is writing several times every time the VISA write VI executes while the computer only writes once as intended. Arduino: Code:
void setup() {
// put your setup code here, to run once:
Serial.begin(57600);
delay(2000);
Serial.print("on\n");
}
void loop() {
static String C = "wait\n";
if (Serial.available() > 0)
{
C = Serial.readString();
Serial.print(C);
}
}
|
|
#8
|
||||
|
||||
|
Re: Quick fix for getting serial data from CMUcam5 Pixy
nice work. Is there any reason you chose this method or i2c
|
|
#9
|
||||
|
||||
|
Re: Quick fix for getting serial data from CMUcam5 Pixy
One is how easy the wiring is:
Plug in provided ribbon cable (Pixy to Arduino) Plug in USB cable (Arduino to RoboRIO) It's basically impossible for that set up to go wrong. I also find that rs-232 style serial communication is (was...) very easy to wrap my head around. Has anyone else tested this by the way? |
|
#10
|
||||
|
||||
|
Re: Quick fix for getting serial data from CMUcam5 Pixy
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|