I want to make a custom anemometer and use it with a bmp180.
my idea is an ir led an d disk with 1 hole and make a read to get rpm's.
My problem is when anemometer is stoped cant get value and program stuck.
There is a tutorial about how can i make a custom sensor to connect to arduino.
Why would your program wait forever for a pulse from your light sensor? You need to be sampling for a fixed amount of time anyway even if it for an entire minute to get revolutions per minute. After that time if the count is zero because of no wind then the value is zero RPM and you would show that. No need to be "stuck". But a much shorter time sample would probably be more practical. And if you use an interrupt method to capture pulses from your light sensor, you don't even have to be stuck while doing the sampling, even if there is wind.
Are you really measuring RPM or are you measuring RPS, revolutions per second? My anemometer uses a reed switch, but the function is the same as yours. Count interrupts and then once per second retrieve and reset the count. Compute the wind speed for that one second period. How do you have it programmed?
Paul
If your program gets stuck waiting for input, than that's where the problem is, not with the sensor. If you want help with that, post your program, and preferably also details on the actual hardware attached to your Arduino.
What's the role of the BMP180 in this? I know that as an atmospheric pressure/temperature sensor.