Skip to content

Advice / suggestions on converting numbers to these back-to-front tuples #11

@jc508

Description

@jc508

Hi I am porting code from Arduino to micropython but I have numbers not little endian byte arrays.
Could you please advise how to do this (easily) - better yet could you maybe add a new method say 'set_offsets_numeric'

What I have to convert is ...

*>>>>>>>>>
    Accelerometer: -23 -12 -36 
    Gyro: -9 -2 1 
    Mag: -826 1222 1759 
    Accel Radius: 1000
    Mag Radius: 807
*/
    adafruit_bno055_offsets_t calibrationData;  // declare the buffer, holds 11 variables
    calibrationData.accel_offset_x = -23;
    calibrationData.accel_offset_y = -12;
    calibrationData.accel_offset_z = -36;
    calibrationData.mag_offset_x   = -826;  
    calibrationData.mag_offset_y   = 1222; 
    calibrationData.mag_offset_z   = 1759; 
    calibrationData.gyro_offset_x  = -9;
    calibrationData.gyro_offset_y  = -2; 
    calibrationData.gyro_offset_z  = 1;
    calibrationData.accel_radius   = 1000; 
    calibrationData.mag_radius     = 807;

    myIMU.setSensorOffsets(calibrationData);

Maybe even better again if you give me a few hints how to handle Byte and Bytearray I could write the module and give it back to you. I am going to have to write it anyway.
Thanks
JC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions