Bonjour à tous les utilisateur de Flowcode,
Je souhaiterai adresser un seul bit d'un $PortA dans un bloc de calcul, comme si j'utilisais la fonction bit unique dans un bloc de sortie. Je ne sais pas si une fonction calcul existe.
Pouvez vous m'aider.
Merci d'avance pour votre aide.
Lecalou60
Adressage de $Port
Moderator: Benj
-
- Posts: 80
- Joined: Fri Jul 20, 2012 8:55 am
- Location: Chambly (France)
- Been thanked: 4 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Adressage de $Port
Bonjour,
Oui, vous pouvez le faire en utilisant cette syntaxe.
Pour écrire à la broche.
$ PORTA.0 = 1
ou de lire à partir de la broche.
Var = $ PORTA.0
Hello,
Yes you can do it using this syntax.
To write to the pin.
$PORTA.0 = 1
or to read from the pin.
Var = $PORTA.0
Oui, vous pouvez le faire en utilisant cette syntaxe.
Pour écrire à la broche.
$ PORTA.0 = 1
ou de lire à partir de la broche.
Var = $ PORTA.0
Hello,
Yes you can do it using this syntax.
To write to the pin.
$PORTA.0 = 1
or to read from the pin.
Var = $PORTA.0
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 80
- Joined: Fri Jul 20, 2012 8:55 am
- Location: Chambly (France)
- Been thanked: 4 times
Re: Adressage de $Port
Hello Benj,
Again thank you for your information.
I just have another question. Addressing a direct port is:
$ 1 = PORTA.0
I wish to put a variable in place of the letter from the port, and another variable to address.
Example of what I'd like to achieve:
PORTA.0 $ = $ 1 + LettreduPort Port (1) = .NumeroduPort EtatduPort
LettreduPort (1) = "A"
NumeroduPort = 0
EtatduPort = 1
Is this the correct syntax? Is this possible.
Thank you for your help.
pascal
Bonjour Benj,
Encore merci pour tes informations.
J'aurai juste une autre question. L'adressage d'un port direct est donc:
$PortA.0=1
Je souhaiterai mettre une variable à la place de la lettre du port, et une autre variable pour son adresse .
Exemple de ce que j'aimerai réaliser:
$PortA.0=1 $Port+LettreduPort(1).NumeroduPort= EtatduPort
LettreduPort(1)="A"
NumeroduPort=0
EtatduPort=1
Est-ce la bonne synthaxe? Est-ce possible.
Merci de ton aide précieuse.
Pascal
Again thank you for your information.
I just have another question. Addressing a direct port is:
$ 1 = PORTA.0
I wish to put a variable in place of the letter from the port, and another variable to address.
Example of what I'd like to achieve:
PORTA.0 $ = $ 1 + LettreduPort Port (1) = .NumeroduPort EtatduPort
LettreduPort (1) = "A"
NumeroduPort = 0
EtatduPort = 1
Is this the correct syntax? Is this possible.
Thank you for your help.
pascal
Bonjour Benj,
Encore merci pour tes informations.
J'aurai juste une autre question. L'adressage d'un port direct est donc:
$PortA.0=1
Je souhaiterai mettre une variable à la place de la lettre du port, et une autre variable pour son adresse .
Exemple de ce que j'aimerai réaliser:
$PortA.0=1 $Port+LettreduPort(1).NumeroduPort= EtatduPort
LettreduPort(1)="A"
NumeroduPort=0
EtatduPort=1
Est-ce la bonne synthaxe? Est-ce possible.
Merci de ton aide précieuse.
Pascal
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Adressage de $Port
Bonjour Pascal,
Je ne pense pas que vous pouvez construire la chaîne $ PORT aide de variables. La façon de le faire serait d'utiliser un certain nombre de déclarations switch imbriqués, d'abord pour le port et pour les bits dans le port.
Hello Pascal,
I don't think you can build up the $PORT string using variables. The way to do this would be to use a number of nested switch statements, first for the port and then for the bits within the port.
Je ne pense pas que vous pouvez construire la chaîne $ PORT aide de variables. La façon de le faire serait d'utiliser un certain nombre de déclarations switch imbriqués, d'abord pour le port et pour les bits dans le port.
Hello Pascal,
I don't think you can build up the $PORT string using variables. The way to do this would be to use a number of nested switch statements, first for the port and then for the bits within the port.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 80
- Joined: Fri Jul 20, 2012 8:55 am
- Location: Chambly (France)
- Been thanked: 4 times
Re: Adressage de $Port
Hello Benj,
I'm trying to test something. I said 20 macro in which I established a calculation block to light a led.
either:
$ PORTA.0=1 eg PortA0_On macro.
$ PortA.1 = 1 in the macro PortA1_On
$ PortC.6 = 1 for the last 20 macro.
Etc .....
So every macro lights a bit of my CPU.
It just remains for me to declare a variable that takes the value of the macro call. Is this possible?
Is the style:
Appel_Macro = PortA0_On
How do I call a macro in a variable.
Thank you for your help.
pascal
Bonjour Benj,
je suis en train de tester une chose. J'ai déclaré 20 macro dans lequel j'ai établis un bloc de calcul pour allumer une led.
Soit:
$portA.0=1 par exemple dans la macro PortA0_On.
$PortA.1=1 dans la macro PortA1_On
$PortC.6=1 pour la dernière macro 20.
Etc.....
Donc chaque macro allume un bit de mon processeur.
Il me reste juste à déclarer un variable qui prend la valeur de l'appel de la macro. Est-ce possible?
Soit du style:
Appel_Macro=PortA0_On
Comment puis-je appeler une macro dans une variable.
Merci de ton aide.
Pascal
I'm trying to test something. I said 20 macro in which I established a calculation block to light a led.
either:
$ PORTA.0=1 eg PortA0_On macro.
$ PortA.1 = 1 in the macro PortA1_On
$ PortC.6 = 1 for the last 20 macro.
Etc .....
So every macro lights a bit of my CPU.
It just remains for me to declare a variable that takes the value of the macro call. Is this possible?
Is the style:
Appel_Macro = PortA0_On
How do I call a macro in a variable.
Thank you for your help.
pascal
Bonjour Benj,
je suis en train de tester une chose. J'ai déclaré 20 macro dans lequel j'ai établis un bloc de calcul pour allumer une led.
Soit:
$portA.0=1 par exemple dans la macro PortA0_On.
$PortA.1=1 dans la macro PortA1_On
$PortC.6=1 pour la dernière macro 20.
Etc.....
Donc chaque macro allume un bit de mon processeur.
Il me reste juste à déclarer un variable qui prend la valeur de l'appel de la macro. Est-ce possible?
Soit du style:
Appel_Macro=PortA0_On
Comment puis-je appeler une macro dans une variable.
Merci de ton aide.
Pascal