PDA

View Full Version : Button command explanations



F1CHF
- 26th October 2006, 12:52
Hello,
I didn't find any explanations about BUTTON command, so :
in the help I see
BUTTON Pin,Down,Delay,Rate,BVar,Action,Label
question:
Tell me if I can use this Command for this need.
Assume that somebody depress a DTMF unit, so I am aware of a code is
present looking to the STROBE input of a MT8870 for example.

I need to DO a ONE step (right or left depending of the DTMF code)
and if the guy is maintaining the DTMF strobe... let say after 500 ms
I will continue to send Right or left order(s) to the Servo motor.
and as soon the button is released, I will return to the main routine
waiting for a new DTMF.

Is the button command can help me ?

if fact i do not really understand the meanning of autorepeat and the Action
label interraction.

Thanks in advance for your good support.
Francois

Acetronics2
- 26th October 2006, 13:34
Hi, François

The BUTTON function can be used to look at the StD pin ( 15 or 17 ) ...

BUT, to work properly, this pin must be regularly scanned to see if a tone couple has been detected ... ( same use as IF pin x = 1 THEN ...but "anti rebond" included )

OR use an interrupt if the program must react quickly.

What about TSM , rue des 15 arpents ( or so ...) ???

Hé,hé !!!

Alain

mister_e
- 26th October 2006, 15:34
Futura science invaders :D

Well button may help or not, as Alain said. But i would personnally choose an interrupt routine or a tight loop with some PAUSEUS to do the job. I'm not a fan of this Button command so far...

Any snip of what you tried?