
Originally Posted by
joseph
i'm having problem working with a conditional program,
------ INPUTS-------|-----OUTPUTS-----
FWD---Neut--REvs-|---forward---revers
--0-------0------1---|------0-----------1
--1-------0------0---|------1-----------0
--0-------1------0---|------0-----------0
--0-------1------1---|------0-----------0
--1-------1------0---|------0-----------0
also i have problem on making PORTA.7 work as an input
TIA.
Hi, joseph
@ first ...
your motor must be powered only if ( FWD ^ REVS = 1 ) AND ( NEUT = 0 ) ... ELSE outputs OFF
after that
forward = FWD and reverse = NOT forward ...
what gives us ...
Code:
IF ( FWD ^ REVS ) AND NOT NEUT THEN
forward = FWD : reverse = NOT forward
ELSE
forward = 0 : reverse = 0
ENDIF
Instead of writing :
Write
Code:
TRISA = % 01011111 ' 95 in binary
And you see instantly ... you've set Porta.7 as an output ...
Alain
Last edited by Acetronics2; - 4th July 2010 at 16:49.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks