Page 1 of 1

PostPosted: Thu Jan 24, 2002 10:00 am
by walfisch
<font face=Comic Sans MS>
<img src=icon_smile_big.gif border=0 align=middle>
I have a problem: I want to programm an application in wich beeps and while it beeps, I want to press a button, with which I can stop the beep and do something other. Can you help me?
(The main problem is, that I want to run two functions at one time: first the beeps and second a function which allows me to stop the first by tapping on the screen)
I will be glad, if you can help me
PS:Sorry if my english isn't so good, but I'm a swiss
</font id=Comic Sans MS>

PostPosted: Thu Jan 24, 2002 5:05 pm
by soinsg
This code works on the emulator:

// Beeps and Taps
// Beeps twice a second until
// the stylus taps the screen

int e, keepGoing=1;

main() {
/* Keep looping until 'keepGoing' doesn't equal 1 */
while (keepGoing == 1) {
e = event(50); // Wait for upto 1/2 second
if (e == 2) // Pen down event
keepGoing = 0;
tone(700, 20); // tone(frequency, milliseconds)

PostPosted: Thu Jan 31, 2002 7:12 pm
by walfisch
Thanks, it WORKS!!!!!!