Change data collection to collect every 5 seconds

edited February 2019 in Android

BarometerBosch baroBosch = metawear.getModule(BarometerBosch.class);

                '''baroBosch.configure()
                        .filterCoeff(BarometerBosch.FilterCoeff.AVG_16)
                        .pressureOversampling(BarometerBosch.OversamplingMode.ULTRA_HIGH)
                        .standbyTime(5.0f)
                        .commit();


                baroBosch.pressure().addRouteAsync(source ->
                        source.stream((Subscriber) (data, env) ->
                        {
                            Log.i("Barometer", "Pressure (Pa) = " + data.value(Float.class));

                        })).continueWith((Continuation<Route, Void>) task -> {
                    baroBosch.start();
                    return null;

                });'''

How can I make the program collect pressure data every 5 seconds?

Figured it out. I used the standby time and put 3000. I didn't realize it was in ms

Comments

  • @c625v12,

    Nice job. You can use built in functions like our timers and accumulator to down-sample any sensor reading.

Sign In or Register to comment.