Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Infra Red remote control
Message
De
17/08/2001 00:17:00
 
 
À
14/08/2001 23:02:52
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00542645
Message ID:
00545146
Vues:
14
Hi:

I have a working application using IR Remote Controls. It's not the one mentinoed here, however, I'll explain how I got mine working and perhaps
you could apply some to your project.

First. I am assuming that you have both a IR Remote Control device and a
IR Receiver device.

Using Windows "HyperTerminal", with the IR Receiver attached to a COM Port,
you should be able to obtain the ASCII value sent by each button on your
IR Remote. Write it down or put in a database ... as to which ASCII value
belongs to which remote button.

The following is for you to just test things out. Apply it however you
want to your actual program.

Create a test.frm and drop MSComm32.OCX in the form (test.frm). Set some
parameters such as COMPORT, PORTOPEN, etc.

In the OnComm Eevent method of MSComm32 enter the following

LOCAL lcButtonValue

WITH THIS
IF .CommEvent = 2
IF .InBufferCount > 0
lcRemoteButton = .Input
.InBufferCount = 0
THISFORM.TakeAction(lcRemoteButton)
ENDIF
ENDIF
ENDWITH

Create a method called TakeAction.
Test::TakeAction
LPARAMETERS vcRemoteButton
DO CASE
CASE vcRemoteButton = ASCII_Value1
DO Something1()
CASE vcRemoteButton = ASCII_Value2
DO Something2()
ENDCASE

ASCII_Value(x) is the ASCII value you got from MS HyperTerminal for each
button on your IR Remote Control.

Perhaps you may want to have something like the below (just to get started):
*first create txtASCII on your form.
THISFORM.txtASCII.VALUE = vcRemoteButton in the Something(x) method.

Run the form. Everytime you press a button, the ASCII code for that
button should show in txtASCII. Of course, in your actual application,
it will do a lot more than display ASCII values.

Don't forget to attach the IR Recriver in the right COM port, turn the COM
Port On ... set bit rates ... etc.

Let me know if you need more info.

HTH

Mal



>>I have IR remote control (included on the PCTVRAVE package from pinaclesys ) and I want to be able to recognize wich key has been pressed. Does any one experienced something like this? Any tip will be a great help.
>>Thank´s in advance,
>>NPedro
>
>Nuno ...
>
>i looked into websites about the PCTV RAVE, but it did not explain much
>to me about what it could do and how it worked. is your remote control
>an ordinary handheld remote like people use for a tv, or is it attached
>to your computer ?
>
>am interested in your application, because i've developed a project
>that has undergone 4 evolutions, from a kludgey mess to a nice neat
>package. always like to keep abreast of alternatives !!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform