Quote Originally Posted by .n0rig. View Post
thanks tony, I figured the whole serin and serout deal but I was just wondering if I can do that on any of the pic's pins?
SERIN, SEROUT, SERIN2, SEROUT2, . . . YES, HSERIN HSEROUT, NO on these you must use the hardware ports
Quote Originally Posted by .n0rig. View Post
Also, I know this is going to sound really dumb, but it is something I have been trying to fix for such a long time. I have been trying to use button debouncing with if then statements but they don't seem to work.

Let us say this is the beginning of my code:
Code:
gosub rightbuttoncheck  ;high then check right side. If right not, then restart.

goto start

rightstart:
gosub nap54ms
if GPIO.3 = 0 then start

gosub checkRmode

rightstart2:
nap 6               ; low power mode for 1.152 of a sec.
if rightbutton = 0 then start
I don't know how to do a "if tact switch (momentary) is pressed, then goto [labe]" type of deal. I tried using the "button" command but that just gave me too many errors that I just dropped it. I was thinking of putting assembly in the and using btsfc or whatever I know some assembly...just to get me around and understand what a program is doing.

So, if I had a a chip, a wire connect to that chip's pin, that wire to a pin of a momentary tact switch, then the other end to the ground or ground pin of the pic chip. How would I do that in basic, will the above If then statements work...well...they have not worked with me even when I change it to "if rightbutton = 1 (or a 0) then [label]".

Regards and thanks for everything!

P.S. are there any cheaper alternatives to this...is there no example code I can follow?
Just use 2 if then loops with a short delay between them.
Code:
LOOP:
If portA.1 = 1 then
pause 5
if PortA.1 = 1 then
{ your code here}
ELSE
goto LOOP
ENDIF
ENDIF

GOTO LOOP