Forum

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

Home Forums Temas ou Discussões Is it possible to take pictures with the Camera of Pleo Rb?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Jacob
    Guest
    Post count: 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
    Guest
    Post count: 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
    Guest
    Post count: 172

    JacoThank you very much for your answer.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Home Forums Temas ou Discussões Is it possible to take pictures with the Camera of Pleo Rb?