gp2d120.h File Reference

Go to the source code of this file.

Defines

#define GP2D120_MAX   1024
 Maximum value returned by the sharp gp2d120 sensor.
#define GP2D120_MIN   0
 Minimum value returned by the sharp gp2d120 sensor.

Functions

long read_gp2d120_raw ()


Define Documentation

#define GP2D120_MAX   1024
 

Maximum value returned by the sharp gp2d120 sensor.

Definition at line 32 of file gp2d120.h.

#define GP2D120_MIN   0
 

Minimum value returned by the sharp gp2d120 sensor.

Definition at line 34 of file gp2d120.h.


Function Documentation

long read_gp2d120_raw  ) 
 

Reads the sharp gp2d120 distance sensor and returns the raw sensor value.

Returns:
the current raw sensor value, with GP2D120_MIN =< sensor value =< GP2D120_MIN.

Definition at line 52 of file gp2d120.h.

00053 {
00054         long distance_raw = 0;
00055         // adc channel 2 (port a2) for the new distscroller board, 0 for the old.
00056         set_adc_channel(2);
00057         delay_ms(2);
00058         distance_raw = read_adc();
00059         return(distance_raw);
00060 }


Generated on Tue Nov 30 09:16:49 2004 for Smart-Its Headers by  doxygen 1.3.9.1