input question for pic 877

Status
Not open for further replies.

goodpickles

New Member
Hello!
Can anybody tell me the code to get input from a switch? The chip is a pic 16f877a and I am using the basic programming language.
 
this is mplab program:

#DEFINE Switch PORTA,2

loop: BTFSC Switch
goto .......
goto........
 
mikesmixes said:
this is mplab program:

#DEFINE Switch PORTA,2

loop: BTFSC Switch
goto .......
goto........

Doesn't help much when he's using BASIC?, although he doesn't mention what BASIC compiler he's using - which isn't much help either!.
 
yes I know how it is done in assembler...I need to know how to do it in basic. By the way I am using oshensoft's compiler/simulator
 
goodpickles said:
yes I know how it is done in assembler...I need to know how to do it in basic. By the way I am using oshensoft's compiler/simulator

Presumably the documentation that comes with it will explain?, and there's bound to be an example of how to do such a basic task?.
 
OK I figured out how to do it.
Just posting it in-case it may help someone else.

If PORTD.7 Then 'if port d pin 7 is high do the next line
PORTA.0 = 1 'make port a pin 0 high
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…