Skip to content

Commit

Permalink
fix map range
Browse files Browse the repository at this point in the history
this was using a hardcoded 4095 but should've been ranging from 0 to ANALOG_MAX
  • Loading branch information
TwidgeVR authored Nov 18, 2021
1 parent c84cbc1 commit 63f563c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion firmware/lucidgloves-firmware/input.ino
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int* getFingerPositions(bool calibrating, bool reset){

for (int i = 0; i<5; i++){
if (minFingers[i] != maxFingers[i]){
calibrated[i] = map( rawFingers[i], minFingers[i], maxFingers[i], 0, 4095 );
calibrated[i] = map( rawFingers[i], minFingers[i], maxFingers[i], 0, ANALOG_MAX );
#if CLAMP_ANALOG_MAP
if (calibrated[i] < 0)
calibrated[i] = 0;
Expand Down

0 comments on commit 63f563c

Please sign in to comment.