Close

Upgrade to Pixy Camera

A project log for Autonomous Agri-robot Control System

Controlling autonomous robots the size of a small tractor for planting, weeding and harvesting

capt-flatus-oflahertyCapt. Flatus O'Flaherty ☠ 06/01/2018 at 11:300 Comments

Pixy2 is out! …. And it does line vector recognition:

#include <Pixy2.h>
#define X_CENTER         (pixy.frameWidth/2)
Pixy2 pixy;
int32_t pan; 

void setup()
{
  Serial.begin(115200);
  Serial.print("Starting...\n");
  pixy.init();
  pixy.changeProg("line");
  pixy.setLamp(1, 1);
}

void loop()
{
  pixy.line.getAllFeatures();
  pan = (int32_t)pixy.line.vectors->m_x1 - (int32_t)X_CENTER;
  Serial.print("pan:  ");Serial.println(pan);
}

…. Now just need it to stop raining outside so it can be tested on blue rope pinned down on vegetable beds.

Discussions