The force sensor is an external device that is connected to the hub through a port. The force sensor library can retrieve the amount of force applied to the force sensor, and detect if it has been pressed.
integer
None
1
2
3
use Libraries.Robots.Spike.ForceSensor
ForceSensor fs
integer forceSensorPort = fs:GetPort()
None
integerport
The port (0 through 5) the force sensor is attached to and what port number the force sensor object will be set to
1
2
3
use Libraries.Robots.Spike.ForceSensor
ForceSensor fs
fs:SetPort(0)
integer
None
1
2
3
use Libraries.Robots.Spike.ForceSensor
ForceSensor fs
integer currentForce = fs:GetForce()
integer
None
1
2
3
use Libraries.Robots.Spike.ForceSensor
ForceSensor fs
integer currentRawForce = fs:GetRawForce()
boolean
None
1
2
3
use Libraries.Robots.Spike.ForceSensor
ForceSensor fs
boolean isForceSensorPressed = fs:IsPressed()