Skip to content

Setting precision to mm #36

@berbaba

Description

@berbaba

Hello!

I have been trying to change the precision of the device's reads but have been unsuccessful.

The TFMPlus.h file includes a line (137) with the definition for STANDARD_FORMAT_MM assigned to a certain hexadecimal value. This is next to other commands like SET_FRAME_RATE (with its corresponding hexadecimal value) that are used with the sendCommand() function in the TFMPlus.cpp, but said function works for the following commands:
SET_FRAME_RATE
SET_BAUD_RATE
OBTAIN_FIRMWARE_VERSION
SYSTEM_RESET
RESTORE_FACTORY_SETTINGS
SAVE_SETTINGS
and the change of format is not implemented here.

I would like to be able to fix this but I don't have enough knowledge and the warning of causing the device to be unresponsive prevents me from changing some things.

As far as I understand it should follow the commented steps in the function:

bool TFMPlus::sendCommand( uint32_t cmnd, uint32_t param)
{
   // Step 1 - Build the command data to send to the device

 if( cmnd == STANDARD_FORMAT_MM)     // If the command is Standard Format MM...
    {    
              memcpy( &cmndData[ 3], &param, X);     // add the X byte Standard Format parameter. 
// 3 is the array position for the example I copied (SET_FRAME_RATE)
// but maybe in this case is different. I don't know X either.
    }
 
     // Step 2 - Send the command data array to the device

     // Step 3 - Get command reply data back from the device.

    // Step 4 - Perform a checksum test.

    // Step 5 - Interpret different command responses.

    // Step 6 - Set READY status and go home

}

I assume steps 2, 4 and 6 should stay the same, but don't know if this command generates a reply or not (steps 3 and 5).
At the moment there is not much more I can do.

Anyway, thank you for the library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions