Quote:
Originally Posted by Generalx5
Is there still a way to make the Digital Inputs default to low?
|
I don't think so.
Quote:
Originally Posted by Generalx5
The other way to do this is...making them all analog? would that work?
|
Yes, I believe it would.
Well, from your description of the sensor, it seems that you could plug it in to an analog input, and then simply use it as a sort of digital sensor in the following manner (let's pretend the sensor is plugged into analog input 1):
PHP Code:
#define TRUE !0
#define FALSE 1
#define THRESHOLD_VALUE 500
#define OBJECT_SENSOR_INPUT rc_ana_in01
unsigned char objectNearby;
/*You may need to use "<" if I misunderstood how the sensor works*/
if(Get_Analog_Value(OBJECT_SENSOR_INPUT) > THRESHOLD_VALUE) {
objectNearby = TRUE;
} else {
objectNearby = FALSE;
}
You can then use the objectNearby variable to check for the presence of the object and you can change the THRESHOLD_VALUE to make the sensor more or less sensitive.