hi Ben
I have a board with 23 Led's. I use the LED(SMD,PCB). The simulation is working nice. Also in the hardware. But how can I control the Led like a array with index? Or can I use for the "handle" an array?
regards
Stefan
Led's in array
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
- 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: Led's in array
Hi Stefan,
The easiest way is to create a macro with two parameters, LED and state.
In the macro add decisions for each LED, .LED = 0 for example.
Inside the yes branch of the .LED = 0 decision add another decision .State.
In the yes branch of the .State decision switch LED0 on, and in the no branch switch LED0 off.
Copy and paste the .LED = 0 decision in the macro, one for each LED.
You can then use your new macro to easily control all the individual LEDs.
You could even export this as a component if you want to be able to re-use the code again and again in different projects.
Let us know how you're getting on.
The easiest way is to create a macro with two parameters, LED and state.
In the macro add decisions for each LED, .LED = 0 for example.
Inside the yes branch of the .LED = 0 decision add another decision .State.
In the yes branch of the .State decision switch LED0 on, and in the no branch switch LED0 off.
Copy and paste the .LED = 0 decision in the macro, one for each LED.
You can then use your new macro to easily control all the individual LEDs.
You could even export this as a component if you want to be able to re-use the code again and again in different projects.
Let us know how you're getting on.
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Led's in array
Hi Ben
Thank you for the help.
I will do somthing like this.
But how can I build a component from the Macro?
Thank you for the help.
I will do somthing like this.
But how can I build a component from the Macro?
- 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: Led's in array
File -> Component ConfigurationBut how can I build a component from the Macro?
Setup Tab
Specify a Name, Cosmetic Name, Category, Description.
Interface Tab
Set macros you want to be available to Downloadable.
Click OK
File -> Export Component
Export the component file to either one of the following.
v7) C:\Program Files (x86)\Flowcode 7\components - maybe export to your desktop and then manually copy the file to avoid write protection issues.
v8) C:\ProgramData\MatrixTSL\FlowcodeV8\Components
Custom Location) Export to any location on your HDD, then use the View -> Global Options -> Locations Tab to add a folder in the "Look For Components In" text field.
Hope this helps.
More info here if you need it.
https://www.matrixtsl.com/wiki/index.ph ... l_Managers
This is more advanced tutorial but should also cover the basics.
https://www.matrixtsl.com/wiki/index.ph ... eled_robot
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
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Led's in array
Hi Ben
I did my first component...It's working nice. But if I understand it right, I can nod modify the component. I have to save it as a project?
regards
Stefan
I did my first component...It's working nice. But if I understand it right, I can nod modify the component. I have to save it as a project?
regards
Stefan
- 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: Led's in array
Hi Stefan,
If you need to modify the component then you have to go back to your source project, make the changes there and then re-export.
If you need to be able to change things in your component then you can create your own properties (or expose sub properties) to allow you to configure things on the fly without re-exporting.
If you need to modify the component then you have to go back to your source project, make the changes there and then re-export.
If you need to be able to change things in your component then you can create your own properties (or expose sub properties) to allow you to configure things on the fly without re-exporting.
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