473,394 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

a program which rang a bell at certain at certain moments

I was asked to make a program which rang a bell at certain at certain moments. The one way i can think of making it is by using a loop, but i should try to avoid using it and i don't have any idea. I thought of looping, and when the time matched with the specified one, it rang the bell. I do not have it clear how to make it ring. They told me that i had to think of how to develop the program and they would think of how to make the bell ring when i returned 1 or 0. This is the thing: if main() returns any number, the program finishes...!
Any ideas...??? Help is really much appreciated
Apr 11 '07 #1
12 2010
RedSon
5,000 Expert 4TB
Using a good, clear thread title is important. The reasons for this are:

* We want this site to grow, many of our new members find the site using a search engine, by using a good thread title you will help us grow the site by helping us get better search engine rankings.
* Using a good title will benefit you too because other members of the forum will be less likely to skip over your thread and it allows the experts to quickly scan through the forum for questions they know the answer to.
* If the threads are well titled it allows other users to easily see if there have been any threads that could be relevant to their own current problem.
* It is in everybody's best interests to post properly titled threads as the more time the moderators have to spend on managing titles the less time they have available to give answers to the questions posed.

-MODERATOR
Apr 11 '07 #2
Banfa
9,065 Expert Mod 8TB
What platform and operating system are you using?
Apr 12 '07 #3
JosAH
11,448 Expert 8TB
What platform and operating system are you using?
And maybe even more important: what bell?

kind regards,

Jos ;-)
Apr 12 '07 #4
And maybe even more important: what bell?

kind regards,

Jos ;-)

I was told to make a program give a device either zero or one at appropiate moments. The bell is supposed to ring when it's one (don't worry about how to make the bell react, it is out of my responsibility). It should work under WXP
Apr 16 '07 #5
Banfa
9,065 Expert Mod 8TB
If it needs to work under Windows XP then just create a program with a Window (can be invisible if you do not want to be able to see it).

Then set a timer going at an appropriate frequency using SetTimer.

Whenever the timer goes off get the current time using GetSystemTime, compare that to when you wish to have the bell go off and if it is the right time output your 1.
Apr 16 '07 #6
If it needs to work under Windows XP then just create a program with a Window (can be invisible if you do not want to be able to see it).

Then set a timer going at an appropriate frequency using SetTimer.

Whenever the timer goes off get the current time using GetSystemTime, compare that to when you wish to have the bell go off and if it is the right time output your 1.
That's the point. How do i give a device an output?
Apr 17 '07 #7
Banfa
9,065 Expert Mod 8TB
That's the point. How do i give a device an output?
Depends what the device is and how it is connected to the computer.
Apr 17 '07 #8
JosAH
11,448 Expert 8TB
Depends what the device is and how it is connected to the computer.
Also see my reply #4 again ;-)

kind regards,

Jos
Apr 17 '07 #9
And maybe even more important: what bell?

kind regards,

Jos ;-)
The bell is not what i should worry about, it should be conected to the parallel port, then i'll tell the other people which cable(s) will be returning the 1.
I should make a program which does everything, i mean that i should have to open the program and the program would do everything for me. That means not needing to use windows xp scheduler, at least not manually. Thanks for your help. Please ask for clarification if there's something i forgot to write.
Apr 18 '07 #10
JosAH
11,448 Expert 8TB
The bell is not what i should worry about, it should be conected to the parallel port, then i'll tell the other people which cable(s) will be returning the 1.
I should make a program which does everything, i mean that i should have to open the program and the program would do everything for me. That means not needing to use windows xp scheduler, at least not manually. Thanks for your help. Please ask for clarification if there's something i forgot to write.
Well, if that is the point instead, reread Banfa's reply #6.

kind regards,

Jos
Apr 18 '07 #11
Banfa
9,065 Expert Mod 8TB
The bell is not what i should worry about, it should be conected to the parallel port, then i'll tell the other people which cable(s) will be returning the 1.
I should make a program which does everything, i mean that i should have to open the program and the program would do everything for me. That means not needing to use windows xp scheduler, at least not manually. Thanks for your help. Please ask for clarification if there's something i forgot to write.
You do realise that it has taken 10 messages in this thread for you to even get to the point of mentioning the parallel port. This would have moved along more quickly if you had mentioned this in the first place instead of making us try and tease the information out of you.

I suggest that you read this which has much to say on the subject of using the parallel port as a control port.
Apr 18 '07 #12
You do realise that it has taken 10 messages in this thread for you to even get to the point of mentioning the parallel port. This would have moved along more quickly if you had mentioned this in the first place instead of making us try and tease the information out of you.

I suggest that you read [url=http://www.epanorama.net/circuits/parallel_output.html#windowsprogramming]this[url] which has much to say on the subject of using the parallel port as a control port.
Thanks! I guess this website will be enough!
Apr 18 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Tyler | last post by:
Hi ppl, I know it's forbidden to mention Java in this newsgroup but I've been presented with a problem which requires that my C++ program communicate with another java program. What is the...
7
by: Dave Hammond | last post by:
You'd think this was an occasionally asked question, but a search for previous related posts only turned up one from 1999, and that one was never anwered. So... When handling a keypress event,...
2
by: MLH | last post by:
This question, I apologize, is more of a math question than it is an Access question - I'm almost certain. The bell curve is another name for the normal distribution, which is a common type of...
1
by: jessebasketball | last post by:
i am a very beginner programmer and am stuck on a very simple problem. I am trying to make a game where the user is presented with a scenerio and options. ie you are standing in the parking lot...
7
by: tiger786 | last post by:
I am new to programming and studying basics in college .Can somebody write a program on this? The program should monitor a possibly infinite stream of characters from the keyboard (standard...
6
by: Csaba Gabor | last post by:
Is there a way in Mozilla/Firefox to ring the bell? For example, in Emacs or Notepad (on my Win XP Pro system) if you enter certain shortcuts (e.g. ^g or ^q, respectively), you get a sound to let...
3
by: Josh | last post by:
I want to get the ASCII Bell character (7) as a string. How? I'm pulliing my hair out over the stupid little task. HELP!!!!!!!!! ARRRAGGH! -- #####-----#####-----##### POV Tips and Hints at...
24
by: John | last post by:
I know this is a very fundamental question. I am still quite confused if the program call stack stack should always grows upwards from the bottom, or the opposite, or doesn't matter?? That means...
11
by: Steven D'Aprano | last post by:
I'd be interested in hearing people's stories of Eureka moments in Python, moments where you suddenly realise that some task which seemed like it would be hard work was easy with Python. I had a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.