Welcome, Guest. Please login or register.
Did you miss your activation email?

Username: Password:


Pages: [1]   Go Down

Author Topic: Take picture with camera of Pleo rb  (Read 9326 times)

Dca

  • Hatchling
  • Posts: 2
  • Male
Take picture with camera of Pleo rb
« on: May 10, 2012, 08:00:02 AM »

Hi all,
i need your help.
How can i program that my Pleo rb takes 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.


Logged


PleoPet

  • Pleontologist
  • * Posts: 162
  • Female
Re: Take picture with camera of Pleo rb
« Reply #1 on: May 10, 2012, 03:26:22 PM »

Several comments:

"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);
    }

« Last Edit: May 10, 2012, 03:36:00 PM by PleoPet »
Logged

Dca

  • Hatchling
  • Posts: 2
  • Male
Re: Take picture with camera of Pleo rb
« Reply #2 on: May 13, 2012, 03:19:56 AM »

Thank you very much for your answer.
Logged

GreatestCaution

  • Leaving the nest
  • * Posts: 7
  • Male
Re: Take picture with camera of Pleo rb
« Reply #3 on: June 27, 2012, 12:25:41 PM »

Thank you very much for your answer.

Hello guys!
Sorry Dca, You try it? it works?

Can upload the archive sensor.p completely, Dca or PleoPet?

Thank You!
Logged

GreatestCaution

  • Leaving the nest
  • * Posts: 7
  • Male
Re: Take picture with camera of Pleo rb
« Reply #4 on: July 19, 2012, 07:52:03 AM »

Hello,

I trying your code and the more strange is that code runs once of ten.
It's extremly strange, something occure about "while", don't reproduce me "camera_saved".


while (get(property_cam_img_progress) != 0)
        {
            yield();
        }
        // now the picture is saved
        PlaySound(snd_camera_saved);

Any idea??

Thanks.
Logged

lordlacky

  • Following the footsteps
  • * Posts: 10
  • 00 Male
Re: Take picture with camera of Pleo rb
« Reply #5 on: July 30, 2014, 10:44:13 AM »

hi,
i know it is an old thread but i have the same problem like GreatestCaution. the problem is that the code dont work every time. but i dont know why :/
have anybody a solution?
Logged
I'm sorry for my bad english.

kat

  • Pleo Grand Master, 2nd epoch
  • ** Posts: 3924
  • au Female
  • Pleo(s): Kermit (Pink RB), Norbit (Green RB), Pickle(nude RB), Gumble, Minyon and Frankie
  • : 2013 winnerTomato Harvest Festivals
    • Marvin_Martian
    • Kermit
    • Flying_Ace
Re: Take picture with camera of Pleo rb
« Reply #6 on: July 30, 2014, 05:01:55 PM »

I don't know if there is anyone around on the forums any more who attempts pleo programming.  All I can suggest is maybe send PleoPet a personal message and see if she can help you out. 
Logged

Echo538

  • Pleozoologist
  • * Posts: 216
  • ca Female
Re: Take picture with camera of Pleo rb
« Reply #7 on: July 31, 2014, 12:09:34 AM »

Wait... Pleo RB can take pictures? Does it need a micro sd card? How much does one cost, anyway?
Logged

lordlacky

  • Following the footsteps
  • * Posts: 10
  • 00 Male
Re: Take picture with camera of Pleo rb
« Reply #8 on: July 31, 2014, 04:52:18 AM »

Yes PleoRb can take pictures. And now my Code works fine, i have some Problems which i don't understand, but i need some one who know about programming the pleo.

Sorry that my Questions on two diffrent forums, but maybe i can find somebody that can help me.

@Echo538
my micro sd-card costs about 8 € and is 4 GB, but you must try the micro sd-card, because the recommendation is for a card less than 2 GB.
And the pictures are very very low quality

Here is one
« Last Edit: July 31, 2014, 04:57:47 AM by lordlacky »
Logged
I'm sorry for my bad english.

InmemoryofRomeo

  • Global Moderator
  • Pleo Grand Master RB
  • * Posts: 6903
  • au Female
  • Pleo(s): Lilo, Stitch, Pleakley, Jumba, Nani, Yuki, Angus, Pluto
  • : 2011 winner2009 winnerTomato Harvest Festivals
  • SAVE THE EARTH It's the only planet with chocolate
    • Professor
    • Wile_E_Coyote
    • Marcie
Re: Take picture with camera of Pleo rb
« Reply #9 on: July 31, 2014, 05:24:02 AM »

Sadly as Kat said, there are no programmers here anymore. Pleopet is your best bet, many of those who posted here are no longer active members. Good luck, do share if you find out anything.
Logged
Eagerly awaiting Vector and Blue!
Pages: [1]   Go Up
 

SimplePortal 2.3.5 © 2008-2012, SimplePortal