-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
samples: sensor: access_trig: add double tap detection. #83818
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just few comments.
Also note that you have a typo in the commit message ("aslo" instead of "also")
2e17e21
to
16f1526
Compare
Fixed, thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're trying to get away from driver-specific sensor samples. There are other sensor drivers that support the same SENSOR_TRIG_DOUBLE_TAP
and SENSOR_CHAN_ACCEL_XYZ
channels, so if you'd like to add a sample demonstrating this functionality please make it independent of the specific driver implementation.
I also think that it is better to have generic samples for multiple hardware. I can integrate the |
Sounds good, thanks. |
16f1526
to
113d10c
Compare
@MaureenHelm I have integrated the tap detection in |
This is the console output with TAP detection enabled
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also update the README file to reflect the feature?
113d10c
to
b3448ff
Compare
Add the tap detection trigger to the existing example. For this example it uses lis2dw12 accelerometer to detect a double tap. Signed-off-by: Pierrick Curt <pierrickcurt@gmail.com>
b3448ff
to
8e0409b
Compare
Yes, I have updated it |
@@ -41,10 +55,19 @@ int main(void) | |||
return 0; | |||
} | |||
|
|||
#if DT_NODE_HAS_PROP(DT_ALIAS(accel0), tap_mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't seem to be generic enough since only ST sensors have this property. You want this generic sample to also work for the other sensors that support tap trigger (fxos8700, icm42605...), no?
The LIS2DW12 is an advanced 3-axis linear accelerometer.
The driver exists in Zephyr but it is not very easy to configure it and use with trigger detection.
So I added a samples that configure the accelerometer to detect a double tap, the example is running on a stm32f3_disco board with a steval-mki190v1 adapter board