#include "t89c51cc02.h"
#include "datatypes.h"
#include "photosensor.h"
#include "adc.h"
#include "sharp.h"
#include <stdlib.h>
Go to the source code of this file.
Functions | |
void | Photosensor_init () |
initialize photosensor subsystem | |
void | Photosensor_toggle (void) |
toggles LED of selected photosensor | |
WORD | Photosensor_read (BYTE sensornr) |
read the value of a single photosensor | |
Variables | |
BYTE | psensor |
const char | psensor_select [] = {0,0x08,0x10,0x20,0x40,0x80,0,0} |
Definition in file photosensor.c.
|
initialize photosensor subsystem The photosensors are turned off by default. Definition at line 31 of file photosensor.c. References Photosensor_PowerOff, and psensor. Referenced by main(). |
|
read the value of a single photosensor The given sensor is activated first and than sampled with a simple differential scheme.
Definition at line 79 of file photosensor.c. References ADC(), Photosensor_PowerOff, Photosensor_select, and SHARP_PWRCTL. Referenced by main(). |
|
toggles LED of selected photosensor
The photosensor is selected with the Photosensor_select function. Definition at line 44 of file photosensor.c. References Photosensor_PowerOff, Photosensor_select, and psensor. |
|
stores number of active photosensor Definition at line 21 of file photosensor.c. Referenced by Photosensor_init(), and Photosensor_toggle(). |
|
bit masks to activate 1 of 5 photo sensors Definition at line 24 of file photosensor.c. |