I dont think the timing is off becuase I used a portion of the first code to make shure the range of numbers was correct.
I think this was the code but I used 220 through 260 and the led would flash every time it detected the ACG pulse. So I dont think the values are incorrect. I just dont know how to excecute the program.Code:start: if (pulse < 220) or (pulse > 260) then start high GPIO.2 pause 100 low GPIO.2 goto start
I would really like to use this code below because I understand it, it's simple and I can do it all in software. If anyone can please tell me what is wrong with this code please let me know.
Code:pulse var Word x var byte signal var word ANSEL = %00000000 Start: Pulsin PORTC.3, 0, pulse if (pulse < 220) or (pulse > 260) then start signal = 0 x = 1 Loop: pulsin PORTC.3, 0, pulse if (pulse > 90) then ADD_X READ_IR: x = x * 2 if (x = 255) then start serout PORTC.2, 2, [#signal] goto loop ADD_X: signal = signal + x goto read_ir end




Bookmarks