-
Notifications
You must be signed in to change notification settings - Fork 3
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
Imu #519
base: integration
Are you sure you want to change the base?
Imu #519
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.
What impact is there on pill?
imu_clear_tap_interrupt(); | ||
PRINTS("Tap\r\n"); | ||
MSG_Data_t * data = MSG_Base_AllocateStringAtomic("tap"); | ||
if(data){ |
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.
Why not reference a const string?
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.
need to convert the string to MSG_Data_t * which is consumed by the sspi module
/* | ||
*PRINTF("<imu>x:%d y:%d z:%d</imu>\r\n", xyz[0], xyz[1], xyz[2]); | ||
*/ | ||
if(xyz[2] > 1000 && !flipped){ |
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 is dependent on the selected scale
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.
will change
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.
actually, i don't think the scale matters in this, because this is a simple hysteresis on the Z value. Due to the orientation of the imu chip, any positive Z value means Sense has flipped or rolled.
this change is morpheus only |
_register_write(REG_CTRL_6, INT_ACTIVE_LOW ); | ||
|
||
_register_write(REG_CLICK_CFG, 0x3F);//all directions clickable | ||
_register_write(REG_CLICK_SRC, CLICK_SRC_DCLICK | CLICK_SRC_STAP); |
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.
is this register meant to be written to?
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.
looks like its read only, will remove
_register_write(REG_CLICK_THR, 0x06); | ||
_register_write(REG_TIME_LIMIT, 0x04); | ||
_register_write(REG_TIME_LATENCY, 0x24); | ||
_register_write(REG_TIME_WINDOW, 0x7F); |
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.
are the units for these documented anywhere?
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.
nope, i just saw a youtube video of a demo and copied the numbers.
documentation also does not show what the units are
inline uint8_t imu_clear_interrupt_status() | ||
{ | ||
|
||
// clear the interrupt by reading INT_SRC register | ||
uint8_t int_source; | ||
_register_read(REG_INT1_SRC, &int_source); | ||
PRINTF("INT CLR %x\r\n", int_source); |
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.
why move this?
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.
artifact from testing, will revert
@@ -17,6 +17,7 @@ enum imu_hz { | |||
IMU_HZ_1 = 1, | |||
IMU_HZ_10 = 2, | |||
IMU_HZ_25 = 3, | |||
IMU_HZ_400 = 7, |
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.
undocumented rates go all the way up to 1.6 kHz (the resonant freq of the sensing element) but you get reduced resolution...
causes instability to the middle board, do not merge |
DO NOT MERGE
emits commands via SPI uart code
"tap"
and
"flipped [1|0]"