grotius-cnc / hal-core

cnc and robot realtime controller. runs on a hal kernel module.
GNU General Public License v2.0
43 stars 20 forks source link

components/test/test.c | Get/Set parameters for a component already created #20

Closed jjrbfi closed 1 year ago

jjrbfi commented 1 year ago

Hi @grotius-cnc !

I was looking at your code test example and looks pretty nice and is easier to understand than halcompile code style for sure. https://github.com/grotius-cnc/hal-core/blob/main/src/hal/components/test/test.c

Regarding it. What is for you the best way to modify pin values, for a pins already created by other component? In this case: LCEC

Thanks for your time and for the amazing work you are doing here.

grotius-cnc commented 1 year ago

Hi,

You could use a unix command in c++ to set a hal pin. This is not the most elegant solution for time critical things.

system("./halcmd setp ..")

Or create a c++ class where you create a component yourself. Then you can link your component pins to other component pins in a hal file. There are examples how i do this. In gui apps i use this technique.

Ok have fun !

jjrbfi commented 1 year ago

Hi! Thanks for your ideas.

I came up modifying halcmd and fingers crossed. I will see how goes. Thanks again!