A continuacion se expone el programa implementado para un sensor de nivel utilizando arduino y el sensor ultrasonico HC-SR04
int Pin_echo = 13; // defino los pines en Arduinoint Pin_trig = 12;
int transmito = 11;
int led = 10; //indica
void setup()
{
Serial.begin (9600);
pinMode(Pin_trig, OUTPUT); // pines de sensor ultrasonico
pinMode(Pin_echo, INPUT);
pinMode(transmito, OUTPUT);
pinMode(led, OUTPUT);
}
void loop() {
float pulso, cm;
digitalWrite(Pin_trig, LOW);
delayMicroseconds(2);
digitalWrite(Pin_trig, HIGH);
delayMicroseconds(10);
digitalWrite(Pin_trig, LOW);
pulso = pulseIn(Pin_echo, HIGH);
digitalWrite(led, HIGH); // enciendo para ver dato llegando
cm = pulso / 29 / 2; // se divide para dos por el timpo de ida y vuelta
Serial.println(cm); // se envia solo el dato a labview
digitalWrite(transmito, HIGH); // led para ver como se
delay(200); // esta transmitiendo la informacio
digitalWrite(transmito, LOW);
}
Hello my name is Saionara i am a mechanical engineering student, can you send me the code labview and arduino of level meter for my email saionarapeixoto@hotmail.com. Thank you
ResponderBorrarHello my name is Saionara i am a mechanical engineering student, can you send me the code labview and arduino of level meter for my email saionarapeixoto@hotmail.com. Thank you
ResponderBorrarGrettings Saionara can you write me to denveravantasia@hotmail.com
Borrar