IR

 

From Acroname:

Sharp GP2D12 Detector Package

Reference:Report

 

 

Code:(Example)

DEFINE OSC 4
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50

ADCvar VAR WORD

TRISA = %11111111
ADCON1 = %10000010


OUTPUT PORTC.4

main:

ADCIN 0, ADCvar ' Read channel 0 to adval

if (ADCvar > 200) then
high portc.4 '

else
low portc.4

endif

Serout2 PORTC.6, 16468, [DEC ADCvar, 13, 10] ' print it to serial out,
' with linefeed and carriage return (10, 13)

goto main