Connection Between Smartphone and XBee (Arduino)

37 views
Skip to first unread message

Khairul Nizam

unread,
May 31, 2018, 8:31:06 AM5/31/18
to xbee-api
How to trace the distance of the XBee from the smartphone by using RSSI Value technique ? 

This is code i found to calc the distance. 
function calculateDistance(rssi) { var txPower = -59 //hard coded power value. Usually ranges between -59 to -65 if (rssi == 0) { return -1.0; } var ratio = rssi*1.0/txPower; if (ratio < 1.0) { return Math.pow(ratio,10); } else { var distance = (0.89976)*Math.pow(ratio,7.7095) + 0.111; return distance; }}
Can i perform this ?
Reply all
Reply to author
Forward
0 new messages