New to Arduino

Store Forums Video Experimenter General Discussion New to Arduino

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #569
    mcstudio
    Member

    Hi Michael,
    I have just discovered the Arduino Community and your Computer Vision Board. Today I ordered the Arduino Uno from Mouser and the Video Experimenter Shield from you.
    I have a background in programming the Pic with PicBasic from Melabs. I was wondering if you can give ma a programming example of how to turn on 6 different outputs based on the X,Y coordinates of an object that is being tracked. For instance, divide the X grid into 3 equal fields and have output 1 activate for the object being within
    the left field and output 2 activated for object in the middle field etc. The same would apply for the Y grid and outputs 4,5 and 6. I would like to get started with this when my boards arrive this week.

    By the way I love your site and this Arduino Movement is incredible. I wish that I would have discovered this a long time ago.
    Thank You
    Mike C Roseville Mi
    ordered board under Janeen S

    #1245
    Michael
    Keymaster

    It’s very easy to set an output pin with Arduino. Just set the pin as an output pin in your setup() function:

    pinMode(thePin, OUTPUT);

    then to turn it “on” (5V) and “off” (0V), use

    digitalWrite(thePin, HIGH); // set it to 5V

    and

    digitalWrite(thePin, LOW); // set it to 0V

    That’s all there is to it. So, you can use the object tracking example and based on the coordinates set pins HIGH and LOW based on your needs. Keep in mind that the Video Experimenter uses pins 2, 6, 7, 8, 9 and A2. There are plenty of other pins left for you to use.

    See the Arduino site arduino.cc for everything you need to learn Arduino coding.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.