Forum

Is it possible to take pictures with the Camera of Pleo Rb?

Início Fóruns Temas ou Discussões Is it possible to take pictures with the Camera of Pleo Rb?

A visualizar 3 artigos - de 1 a 3 (de um total de 3)
  • Autor
    Artigos
  • Jacob
    Convidado
    Número de artigos: 172

    Hi,

    I need help please. ~

    How can i program that my Pleo rb to take a picture with his camera and save it to the SD-Card.
    I’ve tried to take a picture after a touch of his head. So in the sensor.p file:
    case SENSOR_HEAD:
    {
    new file_name[] = “samplefile”;
    camera_take_picture(file_name);
    }
    But it doesn’t work.

    pleoworld
    Convidado
    Número de artigos: 172

    Hello,

    “camera_take_picture” returns a boolean result, it should be checked.

    Unfortunately “camera_take_picture” only starts the process of taking and saving a picture. It is a slow process, and you need to keep checking a special (undocumented) property to see when it is done.

    Also, be careful with strings stored as data. Unless you need data in a variable, use a literal string. Otherwise it wastes valuable RAM. Also be sure you have “#pragma pack 1” near the start of the source file.

    Here is some code I use in my test program:

    Code: [Select]
    #include “Camera.inc”

    //IF NEEDED
    native bool: camera_take_picture(const file_name[]);
    // some versions of SDK do not have it in Camera.inc

    #pragma pack 1


    // save the picture
    if (camera_take_picture(“A:one.img”)) // save on SD card
    {
    PlaySound(snd_cap_one); // shutter sound
    // wait until done saving
    while (get(property_cam_img_progress) != 0)
    {
    yield();
    }
    // now the picture is saved
    PlaySound(snd_camera_saved);
    }
    else
    {
    PlaySound(snd_capture_error);
    }

    Jacob
    Convidado
    Número de artigos: 172

    JacoThank you very much for your answer.

A visualizar 3 artigos - de 1 a 3 (de um total de 3)
  • Tem de iniciar sessão para responder a este tópico.

Início Fóruns Temas ou Discussões Is it possible to take pictures with the Camera of Pleo Rb?