LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

labview arduino HC-SRO4

Que tal tengo un problema con labview arduino y el sensor ultrasonico HC-SR04 ya tengo el programa en labview pero no se como incluir la libreria en lifa_base para hacerlo funcionar he intentado pero me marca errores por favor agradeceria su ayuda

0 Kudos
Message 1 of 9
(5,790 Views)

If you have LabVIEW 2011 or later, you should use LINX because it has this sensor integrated.

0 Kudos
Message 2 of 9
(3,892 Views)

Hi Nathan_B, do you think that is better use LINX that a .vi to get the distance using HC-SR04 sensor? I say that because I have a .vi that controls the trigger and echo pin and all the processing is made in .vi.. thanks for your answer.

0 Kudos
Message 3 of 9
(3,892 Views)

It's not possible to interface with that sensor directly with LIFA.  It requires a special function available on the Arduino but not available in LIFA.  That special function is used in LINX to interface with the sensor.

0 Kudos
Message 4 of 9
(3,892 Views)

thanks for your answer..so I'm wrong, I'm going to change the .vi and use LINX.

0 Kudos
Message 5 of 9
(3,892 Views)

Hello Nathan.

I have a project on water level measurement using  arduino v1.0.5 , LED and ultrasound sensor HCSR-04, I wish coupled with labview 2011.

But it does not work with labview. Please your support for configuration in Labview, I'll leave the code in arduino.. Thanks

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int trigger=8;

int echo=9;

float pulso, cm;

void setup(){

  pinMode(7,OUTPUT);//electrovalvula de llenado

  pinMode(6,OUTPUT);

  Serial.begin(9600);

  pinMode(trigger,OUTPUT);

  pinMode(echo,INPUT);

  lcd.begin(16,2);

  //lcd.print("Sistema de medicion de nivel de agua");

}

void loop(){

    digitalWrite(7,HIGH);

    delayMicroseconds(5);

  digitalWrite(6,HIGH);

  delayMicroseconds(5);

    digitalWrite(trigger,LOW);

  delayMicroseconds(5);

  digitalWrite(trigger,HIGH);

  delayMicroseconds(10);

  digitalWrite(trigger,LOW);

   pulso= pulseIn(echo, HIGH);

   cm = pulso / 29 / 2;

   lcd.setCursor(0,0);

  lcd.print("dist:");

  Serial.println(cm);

  lcd.setCursor(5,0);

  lcd.print(cm);

  delay(1000);

}

0 Kudos
Message 6 of 9
(3,892 Views)

Well, you can't use your own Arduino code with LIFA/LINX.  You have to use the firmware provided by LIFA/LINX.

0 Kudos
Message 7 of 9
(3,892 Views)

where I can get it? what other steps should I know? You can provide me something about what I want?

Thanks very much

0 Kudos
Message 8 of 9
(3,892 Views)

To use LIFA, you upload the firmware that comes with LIFA (in the firmware folder).  Once you get the firmware uploaded, test out some of the examples to make sure that they work.

0 Kudos
Message 9 of 9
(3,892 Views)