Shop OBEX P1 Docs P2 Docs Learn Events
Pulsin — Parallax Forums

Pulsin

curtiscurtis Posts: 19
edited 2006-05-25 03:14 in General Discussion
Hello,
I have created a circuit with an IR detector module and an rs232 module using the sx tech board. I know each module works but I was not sure if my code is correct. Can someone advise me if this is correct? I cannot see anything on hyperterminal or a VB program that I created.

'
DEVICE········· SX28, OSCXT2, TURBO, STACKX, OPTIONX
FREQ··········· 4_000_000
'
' IO Pins
'
IRin··VAR·RA.0···' IR input
IRout··VAR·RA.1···' IR output
' =========================================================================
' Vaiables
' =========================================================================
IRval······· VAR···· Byte···'pulsin variable
Temp1······· VAR···· Byte···'counter variable
' =========================================================================
· PROGRAM Start
' =========================================================================
Start:
· ' initialization code here
goto Main
Main:
for temp1 = 0 to 15
pulsin IRin,0,IRval
Serout IRout,T9600,IRval
next
end
GOTO Main

Thanks,
Curtis
·

Comments

  • PJMontyPJMonty Posts: 983
    edited 2006-05-25 03:14
    Curtis,

    First verify that you can send data to the PC via RS-232 from the SX board. To do this, write a program that does something simple like send the letter "A" over and over. Once you know that is working, then you can concentrate on the IR part. Don't try and solve two problems simultaneously.
      Thanks, PeterM
Sign In or Register to comment.