'**************************************************************** '* Name : LDR_12F675_oto.BAS * '* Author : [select VIEW...EDITOR OPTIONS] * '* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 18.03.2009 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** DEFINE LOADER_USED 1 'define osccal_1k 1 define osc 4 @ DEVICE pic12F675,XT_OSC,mclr_off '@ DEVICE pic12f675,INTRC_OSC_NOCLKOUT, mclr_off Define ADC_BITS 8 ' Set number of bits in result Define ADC_CLOCK 3 ' Set clock source (3=rc) Define ADC_SAMPLEUS 50 ' Set sampling time in uS adval var byte ANSEL = 0100 ' Set AN2 analog, rest digital OSCCAL = 0 high gpio.1 pause 3000 low gpio.1 loop: 'PAUSE 50 ' PAUSE 250mS ADCIN 2, adval ' Read channel 2 to adval 'if gpio.2=0 then if adval<=50 then high gpio.1 pause 3000 else low gpio.1 endif Pause 100 ' Goto loop ' Do it forever End |
6 Ekim 2013 Pazar
Posted by Adsız on 09:09
with No comments so far
Categories: Elektronik Devreler, LDR Devresi Bas Dosyası 12F675
Kaydol:
Kayıt Yorumları (Atom)
0 yorum:
Yorum Gönder