Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top