Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird battery values #5

Closed
iBicha opened this issue Jan 5, 2018 · 4 comments
Closed

Weird battery values #5

iBicha opened this issue Jan 5, 2018 · 4 comments

Comments

@iBicha
Copy link

iBicha commented Jan 5, 2018

This is probably cpp sdk related, but I'm getting weird values from the battery readings of my MetaTracker.

Voltage jumping from 6 to 27 volts, and charge from 25% to 80% randomly.

Here's a function I use to get the voltage

function GetBattery(device, callback) {
    if(!device || !device.connectedAndSetUp)
        return;

    if(device.battSignal){
        MetaWear.mbl_mw_datasignal_unsubscribe(device.battSignal);
        device.battSignal = null;
    }

    if(!callback){
        return;
    }

    device.battSignal = MetaWear.mbl_mw_settings_get_battery_state_data_signal(device.board);
    MetaWear.mbl_mw_datasignal_subscribe(device.battSignal, MetaWear.FnVoid_DataP.toPointer(function gotTimer(dataPtr) {
        var data = dataPtr.deref();
        var val = data.parseValue();
        callback({
            address: device.address,
            epoch: data.epoch,
            battery: val
        });
        //Unsubscribe
        if(device.battSignal){
            MetaWear.mbl_mw_datasignal_unsubscribe(device.battSignal);
            device.battSignal = null;
        }
    }));

    MetaWear.mbl_mw_datasignal_read(device.battSignal);

}

Is there anything I'm missing? I'm calling this function about twice per minute for now

@scaryghost
Copy link
Contributor

What sensors are you using in addition to reading the battery values?

@iBicha
Copy link
Author

iBicha commented Jan 8, 2018

Oh I see, I'm using several sensors, including accelerometer and gyro, so drawing power is probably interfering with the readings, is that correct?

@scaryghost
Copy link
Contributor

See this thread on our community forum:
http://mbientlab.com/community/discussion/comment/1923/#Comment_1923

@iBicha
Copy link
Author

iBicha commented Jan 9, 2018

Understood, thanks

@iBicha iBicha closed this as completed Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants