Skip to content

Commit

Permalink
lut values qmk#2
Browse files Browse the repository at this point in the history
  • Loading branch information
CubicFX committed Aug 22, 2024
1 parent 57c97b1 commit 1ffb97e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions keyboards/cubicfx/keypad/lut.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ SPDX-License-Identifier: GPL-2.0-or-later */
// const double lut_c = 6.01110636956;
// const double lut_d = 1966.74076381;

const double lut_a = 0.095; // Cubic
const double lut_b = 0.01;
const double lut_c = 0;
const double lut_d = 350;
const double lut_a = -0.0245757915451; // Cubic
const double lut_b = 0.0110907899281;
const double lut_c = 5.9088903529;
const double lut_d = 347.913976103;

uint16_t distance_to_adc(uint8_t distance) {
double intermediate = lut_a * exp(lut_b * distance + lut_c) + lut_d;
Expand Down

0 comments on commit 1ffb97e

Please sign in to comment.