12-07-2015 05:24 AM
Hi guys,
How can we use both servos and HC-sr04 in the same code?
I am in a catch 22 situation where I cannot use both of them as LINX supports the HC-SR04 but not servos, LIFA supports servos but not the HC-SR04.
I'm stuggling to make a pulseIn subVI for this.
Is there any solution for this?
Solved! Go to Solution.
12-07-2015 05:47 AM
As far as I remember, I think you can modify/customise the default Arduino sketch to build in your own custom commands - https://www.labviewmakerhub.com/doku.php?id=learn:tutorials:libraries:linx:misc:adding_custom_comman...
12-07-2015 06:31 AM
Thanks Sam,
I am not an expert in LabVIEW, so is there any simpler way to do it?
Like can we modify subVIs?
12-07-2015 06:38 AM
That is the simplest way to do it! Actually, the hard part is writing the Arduino code for the custom command. From the link I sent you, there is a SubVI that already exists to call the custom command you have defined.
The Arduino toolkits both work in the same way - you run a pre-compiled firmware on the Arduino which does the hardware interfacing and it talks to LabVIEW using a Serial Protocol. The toolkit means you don't need to write any LabVIEW code for the serial protocol, nor do you need to write the Arduino Sketch yourself. The fact that you can modify the sketch to add in custom commands is a pretty powerful feature and saves you having to write your own sketch (or LabVIEW code) from scratch!