Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8873511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:29:00+00:00 2026-06-14T18:29:00+00:00

I’m new to programming. I want to make an image processing program. My problem

  • 0

I’m new to programming. I want to make an image processing program. My problem is I want my program to send me text message (AT COMMAND) if something passes in front of my camera.
Here’s the code:

for( ; contour != 0; contour = contour->h_next )
{
    Sleep(10000);
    char buf[20];
    DWORD read = 0;
    DWORD CommModemStatus;
    DWORD write=1; // Number of bytes to write to serial port
    buf[0] = 72; // Decimal value to write to serial port
    char valor4[26] = ("at+cmgf=1\r");
    BOOL bWriteRC4;
           static DWORD iBytesWritten4;
             bWriteRC4 = WriteFile(hPort, &valor4, 100, &iBytesWritten4,NULL);
char valor[26] = ("at+cmgs=\"+62xxxxxxxxxx\"\r");
            BOOL bWriteRC;
           static DWORD iBytesWritten;
             bWriteRC = WriteFile(hPort, &valor, 100, &iBytesWritten,NULL);
char valor2[17] = ("SOMEONE HAS ENTERED YOU ROOM!!!");
            BOOL bWriteRC2;
           static DWORD iBytesWritten2;
             bWriteRC2 = WriteFile(hPort, &valor2, 100, &iBytesWritten2,NULL);
char valor3 = (char)0x1A;
            BOOL bWriteRC3;
           static DWORD iBytesWritten3;
                 bWriteRC3 = WriteFile(hPort, &valor3, 100, &iBytesWritten3,NULL);
}

If something passes in front of my camera and the movement is captured, that’s mean
contour != 0, so I think it’s just like:

for (contour != 0)
//sending text message....

but apparently when turned on, the camera will adapt to the intensity of light, so I give Sleep(10000); in meant to wait the camera 10 second before text sent. In fact it only made my camera (and the rest of program) waiting for 10 seconds to turn on.

Is there any different way to wait without pausing the program?
I’m already Google it, try something like system("pause"), etc, it doesn’t work.

I’m using Visual Studio 2010 in windows.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:29:01+00:00Added an answer on June 14, 2026 at 6:29 pm

    You could try something like

    #include <time.h>
    ...
    for ( ; contour != 0; contour = contour->h_next) {
        //skip to the next iteration if the program started less than 10 seconds ago
        if (((float)clock())/CLOCKS_PER_SEC) < 10.0) continue;
        ...
    }
    

    The clock() function in time.h returns the number of clock ticks since the program has started. A clock tick is not necessarily a millisecond, so dividing by the macro constant expression CLOCKS_PER_SEC, which specifies the relation between a clock tick and a second, will get you the total number of seconds that have elapsed.

    You can get more information about clock() here: http://www.cplusplus.com/reference/clibrary/ctime/clock/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am currently running into a problem where an element is coming back from
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.