SonarIndex

Overview

NOTE:

This is a new feature in Build 23.

A Garcia has 4 I2C connectors on its main board.  Devantech SRF08 sonars have an I2C interface and may be attached to these connectors.  SRF08 sonars can be given 16 different addresses so up to 16 SRF08 sonars may be attached to the I2C bus.  Attaching extra sonars will require expansion connectors for the I2C bus.

Placing the following line of text with a number that varies from 1 to 16 in the garcia.config file will make the Garcia API allocate Sonar subojects.

The first sonar object will be named "sonar_0".  Addtional sonar objects will be named "sonar_1", "sonar_2", etc.  The first sonar object "sonar_0" will have a default address of 0xE0.  The next sonar objects will have default addresses of 0xE2, 0xE4, etc.  The addresses associated with each sonar object may be changed if necessary.

Accessing Sonar Objects

The Sonar objects have the following names:

If the Garcia API object is named garcia then placing the following line of code in an application will retrieve a pointer to Sonar object 0:

Property Inheritance

Sonar inherits Object properties.

Properties
address
range
light-level

address (int)

The I2C address of the camera.  Can be even numbers in the range from 0xE0 to 0xFE.


range (float)

The range value in current distance units.


light-level (float)

The reading from the light-level sensor scaled from 0.0 to 1.0. 0.0 is darkest. 1.0 is brightest.


version: 1.0, build 81007
© Copyright 1994-2008 Acroname, Inc., Boulder, Colorado.  All rights reserved.