Re: RC Receiver with PIC16F628A Very Glitchy
Im sorry guys this final code is the deal breaker. Even simpler than I previously thought it was going to be.
Turns lights on and off with a quickness. Ill post my RC Car here when i get it finished. Thanks again.
I am using the same board I designed for this post: Home Theater IR remote light switch. Instead of receiving IR signals Its connected to the RC Receiver.
Code:
define osc 20
CMCON = 7
Width var word
Main:
while 1
Pulsin Porta.0, 1, Width 'Wait for a high pulse store the pulse width in the variable "Width."
if (Width > 900) then high porta.1 '1900µs is on state. 1900µs /2 = 950
if (Width < 550) then low porta.1 '1000µs is off state. 1000µs /2 = 500
wend
Last edited by RFEFX; - 19th October 2013 at 20:51.
There are 10 kinds of people. Those that know binary and those that do not.
Bookmarks