QUB-ASL / bzzz

Quadcopter with ESP32 and RaspberryPi
MIT License
7 stars 0 forks source link

Read anemometer data in background #160

Closed alphaville closed 7 months ago

alphaville commented 7 months ago

Patch

Basic Example

with Anemometer() as sensor:
    for _i in range(20):
        print(sensor.all_sensor_data)

More advanced example

Here we choose a data processor and a window length

processor = AverageFilter()
with Anemometer(window_length=5, data_processor=processor) as sensor:
    for i in range(20):
        time.sleep(0.1)
        print(sensor.all_sensor_data)
alphaville commented 7 months ago

@Minanchi I've invited to review this because you'll be working with the anemometer @pdavid747 You should review this code because you can reuse it for the GPS @Runway27 Since you'll be working with GPS too, have a look at this code; it is used to interface the anemometer, but it can be reused for any device that sends data over the serial

jamie-54 commented 7 months ago

will we merge this

alphaville commented 7 months ago

will we merge this

Yes, this was just a patch to feature/87-read_anemometer_data_on_pi; I'm merging now.