Bumper

Read data from Robotino's bumper

Contents

Syntax

bump = Bumper( IPADDRESS )

Description

bump = Bumper( IPADDRESS ) returns 1 if bumper is pressed. Returns 0 otherwise.

Example Usage

bump = Bumper( '192.168.0.1' )

See also

DistanceSensor Example

Code

function [ value ] = Bumper( IPADDRESS )
url = sprintf('http://%s/data/bumper',IPADDRESS);
try
  res = webread(url);
  value = res.value;
catch ME
  sprintf('Read from %s failed with error %s',url,ME.identifier)
  value = 0;
end
end