Menu

Problems with NXTCam

Help
2009-07-27
2013-04-25
  • Diego Alonso

    Diego Alonso - 2009-07-27

    Hi,
    I'm having problems trying to get the data from the NXTCam. Here is my code:

    #include "NXT++.h"
    #include <iostream>
    #include <conio.h>

    using namespace std;

    int main()
    {
        Comm::NXTComm comm;
        if(NXT::OpenBT(&comm))
        {
                cout << "Conected" << endl;
            NXT::NxtCam::NxtCamInit(&comm,IN_3);
            while(!_kbhit()){
                std::vector<std::vector<int>> blobs(8, std::vector<int>(5));
                blobs = NXT::NxtCam::GetNxtCamObjects(&comm,IN_3,3);
                 cout << blobs[0][0] << endl;
               
            }
                   
            NXT::Close(&comm);

        }
        return 0;
    }

    The problem is that nothing is shown on the console and the program ends before I press any key whitout errors. With this program I'm trying to see on the console the position of the detected bloobs.

    Thanks for your time

     
    • Diego Alonso

      Diego Alonso - 2009-07-27

      Sorry, restarting visual c++ the code works perfectly

       

Log in to post a comment.