go away spammer

Author Topic: CMUCam2 + Axon problems  (Read 1868 times)

0 Members and 1 Guest are viewing this topic.

Offline weijie90Topic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
CMUCam2 + Axon problems
« on: December 04, 2009, 03:33:46 AM »
 Hi,

I have a CMUCam which works via Bluetooth. According to its response to the GV command, it is a CMUCam2 v1.00 c6. THe SJ command also works.

I am trying to use the Axon to pipe the output of the SJ (send JPEG) command to the PC via rprintf. However, all I get is

��u�ŭ�EҎ� ����

and then -1s (not shown).

The code I'm using is:


void cmucam_init(void) {
    uart0SendByte('R');
    uart0SendByte('S');
    uart0SendByte('\n');
    delay_ms(500);  // wait 500 milliseconds

    uart0SendByte('R');
    uart0SendByte('M');
    uart0SendByte(' ');
    uart0SendByte('1');
    uart0SendByte('\n');
    delay_ms(500);   // wait 500 milliseconds

    rprintf("CMUcam Initialized\n");  // send out the message through USB
}

void cmucam_test(void){
    uart0SendByte('s');
    uart0SendByte('j');
    uart0SendByte('\r');

    int c;
    int i;
    for (i = 0; i < 10000; i++){
        c = uart0GetByte();
        if (c != -1){
            rprintf("%c", (char)c);
        }
    }
    rprintf("\n\nOK");

    /*Receive_Echo(6000);*/
}




................ In main() ..................

cmucam_init();
cmucam_test();


................ In Axon.c .................

uartSetBaudRate(0, 115200); // set UARTE speed, for the CMUCam


What's going on? I don't think it's an issue with UART bit errors, because I get so little data.

Any help would be greatly appreciated. Thank you so much!

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: CMUCam2 + Axon problems
« Reply #1 on: December 04, 2009, 08:20:48 AM »
I think its
    uart0SendByte('\r);     not    uart0SendByte('\n');
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline weijie90Topic starter

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Re: CMUCam2 + Axon problems
« Reply #2 on: December 04, 2009, 08:34:01 AM »
Ok, but the SJ command does give an \r.

 


Get Your Ad Here