hoi
Ik ben bezig om een IR object detector te maken, maar het wil niet echt lukken.
deze IR detector gebruik ik
en deze led
als ik er een afstandsbediening er op zet doet hij wel wat, maar de led gewoon niet.
Ik heb de led al op een feqentie van 38 en 36 khz te laten knipperen maar hij doet nog steeds niks.
weet iemand hoe ik de led moet aan sturen. ik heb hier ook een pic16F628A. en ik kan basic en ASM
Vaak moet je die IR ontvangers een pulstrein geven, een continu signaal van 38khz wordt weggefilterd. Dus bijv. gedurende 5ms een 38KHz puls, en dan 50ms uit, etc.
dus in basic zo?
while 1=1
FreqOut PORTA.1, 1, 38000
delayms 50
wend
ik had dit al geprobeerd
while 1=1
FreqOut PORTA.1, 1, 38000
wend
en dat werkte niet echt
Kevinoud
Een zak tuinaarde opescheuren
Nee dat werkt niet want dan stuur je weer een vaste frequentie weg en dat wordt juist weggefilterd.
De ontvanger verwacht juist pulstreinen op die 38Khz frequentie. ik heb overigens niet gekeken wat de ontvanger precies doet.
nee je moet de documentatie van proton lezen
bv. de HELP file !
RC5IN 12 14 16
Syntax
Variable = RC5IN
Overview
Receive Philips RC5 infrared data from a predetermined pin. The pin is automatically made an input.
Operators
Variable - a bit, byte, word, dword, or float variable, that will be loaded by RC5In. The return data from the RC5In command consists of two bytes, the SYSTEM byte containing the type of remote used. i.e. TV, Video etc, and the COMMAND byte containing the actual button value. The order of the bytes is COMMAND (low byte) then SYSTEM (high byte). If a byte variable is used to receive data from the infrared sensor then only the COMMAND byte will be received.
Example
Device = 16F877
RC5IN_PIN = PORTC.0 ' Choose the port and pin for the infrared sensor
DIM RC5_WORD as WORD ' Create a WORD variable to receive the data
DIM RC5_COMMAND as RC5_WORD.Lowbyte ' Alias the COMMAND byte to RC5_WORD low byte
DIM RC5_SYSTEM as RC5_WORD.Highbyte ' Alias the COMMAND byte to RC5_WORD high byte
ALL_DIGITAL = ON ' Make all pins digital mode
Cls ' Clear the LCD
While 1 = 1 ' Create an infinite loop
Repeat
RC5_WORD = RC5In ' Receive a signal from the infrared sensor
Until RC5_COMMAND<> 255 ' Keep looking until a valid header found
Print at 1,1,"SYSTEM ",Dec RC5_SYSTEM," " ' Display the SYSTEM value
Print at 2,1,"COMMAND ",Dec RC5_COMMAND," " ' Display the COMMAND value
Wend
Declares
There is a single Declare for use with RC5In: -
DECLARE RC5IN_PIN PORT . PIN
Assigns the Port and Pin that will be used to input infrared data by the RC5In command. This may be any valid port on the PICmicro.
If the Declare is not used in the program, then the default Port and Pin is PORTB.0.
Notes
The RC5In command will return with both COMMAND and SYSTEM bytes containing 255 if a valid header was not received. The CARRY (STATUS.0) flag will also be set if an invalid header was received. This is an ideal method of determining if the signal received is of the correct type.
RC5In is oscillator independent as long as the crystal frequency is declared at the top of the program. If no XTAL Declare is used, then RC5In defaults to a 4MHz crystal frequency for its timing.
See Also
SONYIN
de out staat er niet bij 
Kevinoud
Een zak tuinaarde opescheuren
my bad rc5out is er idd niet. ik heb het nog nooit gebruikt dus zou het voor de rest zo direct niet weten.
RC5IN_PIN wordt gebruikt om een RC5 code van een afstands bediening in te lezen. Als je RC5 uit wil sturen zal je zelf een code moeten maken, bij Frits op de site staan voor beelden onder projecten.
http://www.picbasic.nl/index_picbasic.htm
ik denkt dat ik wat gevonden heb. De leraar had er vandaag ook al over. dit staat ook in de datasheet.(je moet trouwens de japan fonds downloaden anders zie je niet zo veel) maar toen begreep ik het nog niet. (de leraar ook niet trouwens)
maar tijdens het googlen kwam ik dit tegen
dus als ik nu 22x een frequentie uit stuur en dan 1ms niks. Dat ga ik eerst proberen.
Hij doet het. ik heb nu dit. dit had ik gekopieerd van deze site
Start:
T0 = 22
Pulse:
ASM ;// with auto delay between bursts
bsf IRout ;// 1uS, LED=on [need 25uS total
GoTo $+1 ;// 3uS (2uS per goto $+1)
GoTo $+1 ;// 5uS
GoTo $+1 ;// 7uS
GoTo $+1 ;// 9uS
GoTo $+1 ;// 11uS
GoTo $+1 ;// 13uS
bcf IRout ;// 14uS, LED=off
GoTo $+1 ;// 16uS
GoTo $+1 ;// 18uS
GoTo $+1 ;// 20uS
GoTo $+1 ;// 22uS
decfsz T0,F ;// 26uS
GoTo Pulse ;// 28us
ENDASM
dealyus 500 '// 500uS delay between each data bit
GoTo Start
////waarom zit ik nog steeds in mijn code ik kom er niet meer uit////
de spanning op Vout wordt nu laag als hij hem ziet.
Het is mij gelukt
achter af bleek ik de helft moeten af te dekken voor de mensen die dit ook willen proberen dit is mijn eind code
Symbol A0 = PORTA.0
Symbol IRout = PORTB.3
Symbol IRinp = PORTB.0
; 76543210
TRISA = %11111110
TRISB = %11110111
Dim T0 As Byte
Clear
Start:
T0 = 22
Pulse:
ASM ;// with auto delay between bursts
bsf IRout ;// 1uS, LED=on [need 27uS total
GoTo $+1 ;// 3uS (2uS per goto $+1)
GoTo $+1 ;// 5uS
GoTo $+1 ;// 7uS
btfss IRinp
GoTo Led
bcf A0 ;// 11uS
GoTo $+1 ;// 13uS
bcf IRout ;// 14uS, LED=off
GoTo $+1 ;// 16uS
GoTo $+1 ;// 18uS
GoTo $+1 ;// 20uS
GoTo $+1 ;// 22uS
GoTo $+1 ;// 24uS
decfsz T0,F ;// 26uS
GoTo Pulse ;// 28us
ENDASM
GoTo Start
Led:
High A0
GoTo Start
End