Hi,
I'm trying to extract an image from the epuck camera to the matlab using the
bluetooth connection.
I based the image extraction on the first example of the e_po3030k.h, and
used the uart interface to transfer the buffer, containing the image, from
the e-puck to the matlab. All the libraries (matlab-uart and camera) were
retreived from the epuck site/downloads/library/e-puck-latest-svn-trunk
The code is the following:
#include "e_uart_char.h"
#include "e_init_port.h"
#include "e_po3030k.h"
#include "matlab.h"
//buffer containing the image
char buffer[2*40*40];
int main(void)
{
//initializations
e_init_port();
e_init_uart1();
e_po3030k_init_cam();
//begining of the program
e_send_char_to_matlab("CHECKPOINT1",11);
//configuring the camera
e_po3030k_config_cam((ARRAY_WIDTH
-160)/2,(ARRAY_HEIGHT-160)/2,60,160,4,4,RGB_565_MODE);
//?????dont know what is this??????
e_po3030k_write_cam_registers();
//start capturing the image
e_po3030k_launch_capture(buffer);
//after launching the image capture - the e-puck arrives to this stage
e_send_char_to_matlab("CHECKPOINT2",11);
//wait for the image to be captured and the data is on the buffer
while(!e_po3030k_is_img_ready());
//when the image is ready to be sent - E-PUCK NEVER ARRIVES TO THIS
STAGE
e_send_char_to_matlab("CHECKPOINT3",11);
//sending the data to MATLAB - 40*40 RGB565 (16 bits-2 bytes) picture
e_send_char_to_matlab(buffer,2*40*40);
//wait for the epuck to send the data
while(e_uart1_sending());
return 0;
}
I can compile it and upload it to the e-puck. But when the e-pucks boots, it
seems that it stays stuck on a resetting and booting loop. I can see this
because of the checkpoints I put the in the program.
The e-puck keeps repeatedly printing CHECKPOINT1 and CHECKPOINT2 and never
arrives to CHECKPOINT 3. I tried to issuie CHECKPOINT2 after a certain time
has passed (with a timer). It's seems that after a few seconds (1/2 seconds)
of delay the program starts only issueing CHECKPOINT1, so I presume the
rebooting ocurres somewhere arround that delay.
I can't seem to get arround this problem. Could someone please help?
_______________________________________________
E-puck-user mailing list
[email protected]
https://mail.gna.org/listinfo/e-puck-user