Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save martinbowling/b99dfc4ab0897ebc1fb2ef221dced3cb to your computer and use it in GitHub Desktop.
Save martinbowling/b99dfc4ab0897ebc1fb2ef221dced3cb to your computer and use it in GitHub Desktop.
calculate distance with BLE
double getDistance(int rssi, int txPower) {
return Math.pow(10d, ((double) txPower - rssi) / (10 * 2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment