Hi, I'm looking to get two Picaxe 28x1s to send text back and forth via sony ir codes, but I've run into a snag getting signals to move back and forth. Does anyone have a reference for setting these guys up?
My code as it is:
TRANSMITTER:
RECEIVER:
I have a larger program that has a the input and LCD blocks, but I'm testing transmission with this.
I have a pair of "TSOP18 IR Receiver chips" that as far as I can tell are wired correctly with the nessicary circuit and connect to hardware pin 11, (in 0). My transmitters are using some standard Radio Shack IR diodes with a 270 ohm CLR off of hardware pin 22 (out 1). (H pin 23 (out 0) is connected to my LCD)
In case it matters, I'm using protoboards and a 5V power supply, though the end product will use batteries. The finial version will also be able to switch between modes as well, but this is not going to be implemented in this test.
Thanks for any help you can provide!
EDIT:
Just for fun, the rest of the code, in case anyone is curious. As I said above, other than an address change, this should be using the same transceiver code.
My code as it is:
TRANSMITTER:
Code:
Main:
irout 1,1,65
goto main
Code:
Main:
debug
irin [500,Main],0,b0
goto main
I have a pair of "TSOP18 IR Receiver chips" that as far as I can tell are wired correctly with the nessicary circuit and connect to hardware pin 11, (in 0). My transmitters are using some standard Radio Shack IR diodes with a 270 ohm CLR off of hardware pin 22 (out 1). (H pin 23 (out 0) is connected to my LCD)
In case it matters, I'm using protoboards and a 5V power supply, though the end product will use batteries. The finial version will also be able to switch between modes as well, but this is not going to be implemented in this test.
Thanks for any help you can provide!
EDIT:
Just for fun, the rest of the code, in case anyone is curious. As I said above, other than an address change, this should be using the same transceiver code.
Code:
;Piotr Cymbalski - IR Tranciever 2009 - Ver. 5
Init:
setfreq m8
calibfreq 0
pause 5000
; serout 0,T9600_8,(254,0x01) ;Fixes the screen- sets it back to default. Find that code
serout 0,T9600_8,(254,0x01) ;Blank the screen
symbol CurChar = b0 ;The current dial-selected Char
symbol RecChar = b1 ;The last Char recieved over IR
symbol Outlength = b2 ;This stores the number of chars in the outbox
symbol Inlength = b3 ;Stores the number of chars recieved
CurChar = 95 ;Avoids random char on LCD
RecChar = 95 ;Displays a space by default
Main: ;Comment out lines to disable sections. Code will not work with all enabled
gosub GetCurrentChar
gosub DisplayLCD
; if pinX = 1 then gosub SendChar ;This will enable switching between send/rec
; if pinX = 0 then gosub ReceveChar
; gosub SendChar ;This line will be obsolete when SendRec is setup.
gosub ReceveChar
; gosub TypeChar
; Debug
goto Main
GetCurrentChar: ;Surprisingly, POT more complex than LCD
readadc 1, CurChar ;Raw value
CurChar = CurChar/8 ;only 90 of the 256 values are used
CurChar = CurChar+65 ;adjusts for position of "A"
If CurChar>90 Then gosub space ;Space key is 95; "Z" is 90. "A" is 65
return
space: ;Does this need a separate line?
CurChar = 95
return
DisplayLCD:
serout 0,T9600_8,(254,0x01) ;Blank the screen
serout 0,T9600_8,(RecChar,CurChar) ;Print Recived charicter
pause 500 ;Avoids strobe
return
;TypeChar:
; Return
SendChar:
irout 1,1,CurChar
return
ReceveChar:
irin [500,Main],0,RecChar
return
Last edited: