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.
integerNone1
2
3
use Libraries.Robots.Spike.ForceSensor
ForceSensor fs
integer forceSensorPort = fs:GetPort()NoneintegerportThe 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)integerNone1
2
3
use Libraries.Robots.Spike.ForceSensor
ForceSensor fs
integer currentForce = fs:GetForce()integerNone1
2
3
use Libraries.Robots.Spike.ForceSensor
ForceSensor fs
integer currentRawForce = fs:GetRawForce()booleanNone1
2
3
use Libraries.Robots.Spike.ForceSensor
ForceSensor fs
boolean isForceSensorPressed = fs:IsPressed()