This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Description
In the example DrawingInTheAir, even if you don't move the board, there is a detection (at least a very high probability that something is detected even with very slightly similar movement). Hence the rate of false positives is very high.
To reduce the rate of false positives, a check should be done on the distance value from the register IDX_DIST. Hence a threshold can be set on the likelihood of detection, thereby considering any detection with a high IDX_DIST as a no_match.
I'm using a modified classify function like this:
uint16_t Intel_PMT::classify(uint8_t *pattern_vector, int32_t vector_length, uint16_t * dist)
{
uint8_t *current_vector = pattern_vector;
uint8_t index = 0;
if (vector_length > MaxVectorSize) return -1;
for (index = 0; index < (vector_length - 1); index++)
{
regWrite16(COMP, current_vector[index]);
}
regWrite16( LCOMP , current_vector[vector_length - 1] );
*dist = regRead16(IDX_DIST);
return ( regRead16(CAT) & CAT_CATEGORY);
}
But i guess a CuriePME.getIDX_DIST();
after a call to classify should also work.