seb heliboles

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: PC Send Bluetooth #3983
    Author Image
    seb heliboles
    Participant

    I do not understand what I have to write in the table to be understood by the nxt.
    I have to use a procedure?

    • This reply was modified 10 years, 9 months ago by Author Imageseb heliboles.
    in reply to: PC Send Bluetooth #3977
    Author Image
    seb heliboles
    Participant

    I use this code

     #include <cstdlib>
        #include <iostream>
        #include <string>
        #include <conio.h>
        #include "nxt.h"
    
        using namespace std;
    
        Bluetooth *blue = new Bluetooth();
        int port ,erreur=0;
        int main()
        {
    
            try{
                cout << "Tentative de connexion" << endl;
                cout << "Selectionner le port" <<endl;
                while(erreur==0){
                    try{
    
                        scanf("%d",&port);
                        blue->connect(port);
                        cout << "Connexion reussi" << endl;
                        erreur=1;
                    }
                    catch (Nxt_exception& e){
                        printf("- Port %d Erreur \n",port);
                    }
                }
    
            }
            catch (Nxt_exception& e){
            //some error occurred - print it out
                cout << e.what() << endl;
                cout << "error code: " << e.error_code() << endl;
                cout << "error type: " << e.error_type() << endl;
                cout << e.who() << endl;
                return 0;
            }
            unsigned int b=2;
            unsigned char un[]={'0','a'};
            blue->send(&un[0],b);
    
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)
Posted in

Make a donation