Go to Post Of course this should be your decision- not the FIRST community's. Take charge of your destiny. - Wayne C. [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 09-02-2017, 19:06
NoahShorter NoahShorter is offline
Registered User
FRC #4125
 
Join Date: Feb 2017
Location: Umatilla OR
Posts: 1
NoahShorter is an unknown quantity at this point
Arduino, pixy, and RoboRio Communications

My name is Noah, and I am part of team 4125 in Oregon. I am having troubles with receiving data from the arduino. I am writing to the arduino, but not receiving. I am trying to use a pixy for vision processing for the gears.
Code:
#include <SPI.h>  
#include <Pixy.h>
#include <Wire.h>

// This is the main Pixy object 
Pixy pixy;

void setup()
{
  Serial.begin(9600);
  Serial.print("Starting...\n");
  Wire.begin(84);
  Wire.onReceive(receiveEvent);
  

  pixy.init();
}

void loop()
{ 
  
}
void receiveEvent(int howMany)
{
  uint16_t blocks;
  int j;
  blocks = pixy.getBlocks();
  while(Wire.available())
  {
    char c = Wire.read();
    if (c == 1){
      if (blocks)
      {
        pixy.blocks[j].print();
      }
    }
  }
}
This is my code for the arduino. I don't know what else I can say to help explain. but I can answer some questions asked. Thanks.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 19:19.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi