goodpickles New Member Mar 5, 2005 #1 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.
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.
M mikesmixes Guest Mar 5, 2005 #2 this is mplab program: #DEFINE Switch PORTA,2 loop: BTFSC Switch goto ....... goto........
Nigel Goodwin Super Moderator Most Helpful Member Mar 5, 2005 #3 mikesmixes said: this is mplab program: #DEFINE Switch PORTA,2 loop: BTFSC Switch goto ....... goto........ Click to expand... 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!.
mikesmixes said: this is mplab program: #DEFINE Switch PORTA,2 loop: BTFSC Switch goto ....... goto........ Click to expand... 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!.
goodpickles New Member Mar 5, 2005 #4 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
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
Nigel Goodwin Super Moderator Most Helpful Member Mar 6, 2005 #5 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 Click to expand... 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?.
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 Click to expand... 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?.
goodpickles New Member Mar 7, 2005 #6 No. The is documentation does not mention it, and there no example.
goodpickles New Member Mar 10, 2005 #7 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
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