2

I want control my mobile robot by android application.
I use LEGO NXT and nxtOSEK platform http://lejos-osek.sourceforge.net/ecrobot_c_api.htm . If I send command 0x06 0x00 0x80 0x03 0x0B 0x02 0xF4 0x01, my robot give "beep". If I send 0x01 0x02 0x03, values in bt_receive_buf[0], bt_receive_buf[1], bt_receive_buf[2] are still equal zero. How command i must send in order to receive numbers in bt_receive_buf?

Thank you in advance and sorry for my English.

#include "kernel.h"
#include "kernel_id.h"
#include "ecrobot_interface.h"
#include "robot.h"


static U8 bt_receive_buf[32];




/* ECRobot hooks */
void ecrobot_device_initialize()
{
    ecrobot_init_bt_slave("LEJOS-OSEK");
}

void ecrobot_device_terminate()
{
    ecrobot_term_bt_connection();

}

DeclareCounter(SysTimerCnt);

void user_1ms_isr_type2(void)
{
    (void)SignalCounter(SysTimerCnt);
}

TASK(TASK1)//4ms
{

        ecrobot_read_bt_packet(bt_receive_buf, 32);

    TerminateTask();
}

TASK(TASK2)//sonar 50ms, datalog 10ms
{
    TerminateTask();
}

TASK(TASK3)
{


    TerminateTask();
}

//zadanie w tle - obsługa wyswietlacza
TASK(OSEK_Task_Background)
{

    while(1)
    {


            display_goto_xy(0, 1);
            display_int((int)bt_receive_buf[0] ,4);
            display_goto_xy(0, 2);
            display_int((int)bt_receive_buf[1], 4);
            display_goto_xy(0, 3);
            display_int((int)bt_receive_buf[2], 4);
            display_goto_xy(0, 4);
            display_int((int)bt_receive_buf[3] ,4);
            display_goto_xy(0, 5);
            display_int((int)bt_receive_buf[4], 4);
            display_goto_xy(0, 6);
            display_int((int)bt_receive_buf[5] ,4);

        display_update();

    }
}
user3483899
  • 103
  • 1
  • 5
  • [THIS](http://lejos-osek.sourceforge.net/nxt2nxt.htm) should be useful. – LPs Mar 11 '16 at 18:05
  • This is not useful, because above link contains descriptions of comunication between two lego nxt bricks. I am interested in communication between nxt bricks and smartphone. – user3483899 Mar 12 '16 at 17:36

0 Answers0