Skip to content

Conversation

@Mirza-Samad-Ahmed-Baig
Copy link

The core issue was zeroOffset = 0.0 resets the calibration every time you lift your finger. This makes the scale completely unusable because:

  1. When you calibrate the scale by pressing "Zero Scale", it sets the zeroOffset
  2. But as soon as you lift your finger to place an object, the calibration is lost
  3. This defeats the entire purpose of a scale

Additionally, I added:

  1. Persistence: The calibration is now saved to UserDefaults, so it persists between app launches
  2. Reset function: Added a proper resetCalibration() method for when users actually want to reset
  3. Reset button: Added a UI button to reset calibration when needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant