1818281+1818282 Microchip Technology, 1818281+1818282 Datasheet - Page 35

no-image

1818281+1818282

Manufacturer Part Number
1818281+1818282
Description
EDF / AMICUS18 + SHIELD, BUNDLE
Manufacturer
Microchip Technology
Type
Development Boardr

Specifications of 1818281+1818282

Kit Contents
Board
Svhc
No SVHC (15-Dec-2010)
Kit Features
Nine 10-bit ADC Inputs, Two 10-bit PWM Outputs, Two Comparators
Mcu Supported Families
PIC18F25K20
Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC18
Silicon Core Number
PIC18F
Silicon Family Name
PIC18FxxKxx
In order to change the level of darkness that the LDR will react too is simply a matter of changing the
value within the line “If LDR_Value > 400 Then”. A larger value will illuminate the LED at darker
levels. The best way to calibrate the program is to examine the values produced by your particular LDR
in light an dark situations. The program below will display the LDR values on the serial terminal:
' Display the value produced from an LDR
'
'
' Open the ADC:
'
'
'
'
'
'
Once the code is compiled and loaded into the Amicus18, open the serial teminal:
As can be seen from the above screenshot, ambient light levels give an approximate value of 315, so
anything above this value will indicate a light level decrease. However, we don’t want to make it too
sensitive, so a value of 400 is ideal.
Crownhill AssociatesLimited 2009 - All Rights Reserved
Dim LDR_Value As Word
Include
OpenADC(ADC_FOSC_RC & ADC_RIGHT_JUST & ADC_2_TAD, ADC_REF_VDD_VSS, ADC_1ANA)
While 1 = 1
Wend
LDR_Value = ReadADC(0)
HRSOut Dec LDR_Value, 13
DelayMS 500
"ADC.inc"
Fosc Set For internal RC Oscillator
Right justified for 10-bit operation
Tad value of 2
Vref+ at Vcc : Vref- at Gnd
Make AN0 an analogue input
Light Level Dropped Here
Light Level Increased Here
Amicus18 Companion Shield
Version 1.0
' Load the ADC macros into the program
' Create an infinite loop
' Read the ADC value from AN0
' Display the value on the serial terminal
' Wait half a second
' Do it forever
' Holds the 10-bit ADC value from the LDR
34
06-10-2009

Related parts for 1818281+1818282