Added ICM, knob CCs
This commit is contained in:
parent
e757ebc885
commit
00cdfc08e0
7 changed files with 125 additions and 46 deletions
|
|
@ -44,6 +44,7 @@ void initHardware() {
|
|||
breathFilter.setFilter(LOWPASS, FILTER_FREQ, 0.0); // create a one pole (RC) lowpass filter
|
||||
breathAltFilter.setFilter(LOWPASS, FILTER_FREQ, 0.0); // create a one pole (RC) lowpass filter
|
||||
spikeFilter.setFilter(HIGHPASS, 200, 0.0); // create a one pole (RC) lowpass filter
|
||||
icmSensor.begin_I2C(ICM20948_I2CADDR_DEFAULT, &MainI2CBus);
|
||||
|
||||
ledStrip.begin();
|
||||
|
||||
|
|
@ -168,4 +169,17 @@ int readPressure() {
|
|||
|
||||
int readAltPressure() {
|
||||
return breathAltFilter.input(pressureSensorAlt.readPressure()) * PRESSURE_SENS_MULTIPLIER;
|
||||
}
|
||||
|
||||
icm_result_t readICM() {
|
||||
sensors_event_t accel;
|
||||
sensors_event_t gyro;
|
||||
sensors_event_t mag;
|
||||
sensors_event_t temp;
|
||||
icmSensor.getEvent(&accel, &gyro, &temp, &mag);
|
||||
|
||||
return {
|
||||
mag.magnetic.y,
|
||||
mag.magnetic.x,
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue