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.