10-03-2012 12:03 AM - edited 10-03-2012 12:04 AM
Hi all,
I'm developing a mechanical optical modulator as final course project engineering.
I'm using an Arduino UNO board for communication and an infrared sensor that gives me an analog (0-5).
I need to calculate the rotation per second of an engine and the sensor is positioned capturing the gaps and making the cut. (an example is in the attached figure).
I managed to develop the system in C / C # in the Arduino IDE and stayed that way:
-------------------------------------------------- ------------------
val = digitalRead (A3);
if (val == LOW) {
stat = LOW;
digitalWrite (13, LOW);
}
else {
stat = HIGH;
digitalWrite (13, HIGH);
} / / IR the light is invisible for us, the LED on pin 13
/ / Indicate the state of the circuit.
if (stat2! = stat) {/ / When the state change counts, thats from (dark to light) or
/ / from (light to dark), remmember That IR light is invisible for us.
count + +;
stat2 = stat;
}
if (millis ()-last> = milliseconds) {
double rps = ((double) count) / 2.0 * 1000.0/milisegundos;
double rpm = ((double) count) / 2.0 * 60000.0 / (milliseconds);
displayrpm = rps;
count = 0;
last = millis ();
Serial.println (displayrpm, DEC); / / Print at the Serial Interface
-------------------------------------------------- ---------------------
Unfortunately I am not able to write this code in Labview ..
I've tried using the Real Time did not work, I tried to make one. Seen using a "for" but I can not divir by the function "time" ...
Can anyone help me?
Only the engine speed and plot on a graph ..
Nothing more ..
hugs
10-08-2012 11:36 AM
Bom dia Lucas,
lendo sua dúvida pude perceber que você é brasileiro, por isso estou respondendo em Português!
Bem, o algoritmo que você precisa implementar é relativamente simples. Então me fale o que você já conseguiu desenvolver para eu poder lhe ajudar.
Agora também há o Forum em Português: http://forums.ni.com/t5/Discuss%C3%A3o-sobre-Produtos-NI/bd-p/9170
Atenciosamente,