Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
Joe
Published

pixy cmuCAM + Arduino

A quick and simple guide on how to easily connect your Arduino to the pixy cmuCAM!

BeginnerFull instructions provided41,838
pixy cmuCAM + Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
the micro controller.
×1
Pixy
The camera.
×1

Software apps and online services

pixymon
the download link is below the USB cable picture.
Arduino IDE
Arduino IDE
You need this to program your Arduino.

Hand tools and fabrication machines

Pixy Library
You can download the files from the wiki. Just look below the picture and a download link will be there.

Story

Read more

Schematics

There is no schematic, but here is picture

Code

Pixy Hello_World code

Plain text
//
// begin license header
//
// This file is part of Pixy CMUcam5 or "Pixy" for short
//
// All Pixy source code is provided under the terms of the
// GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html).
// Those wishing to use Pixy source code, software and/or
// technologies under different licensing terms should contact us at
// cmucam@cs.cmu.edu. Such licensing terms are available for
// all portions of the Pixy codebase presented here.
//
// end license header
//

/* 
   06.04.2014 v0.1.3 John Leimon
     + Now using pixy.init() to initialize Pixy in setup().
*/

#include <SPI.h>  
#include <Pixy.h>

Pixy pixy;

void setup()
{

  Serial.begin(9600);
  Serial.print("Starting...\n");

  pixy.init();
}

void loop()
{ 
  static int i = 0;
  int j;
  uint16_t blocks;
  char buf[32]; 
  
  blocks = pixy.getBlocks();
  
  if (blocks)
  {
    i++;
    
    if (i%50==0)
    {
      sprintf(buf, "Detected %d:\n", blocks);
      Serial.print(buf);
      for (j=0; j<blocks; j++)
      {
        sprintf(buf, "  block %d: ", j);
        Serial.print(buf); 
        pixy.blocks[j].print();
      }
    }
  }  
}

Credits

Joe
5 projects • 41 followers

Comments