![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
i want to make a circuit to make a led turn on when i push the push button by using these code void main() { TRISA=0B00011111; TRISB=0; loop: if (PORTA.F0==0) { PORTB.F0=1; } else {PORTB.F0=0; } goto loop; } | |
| |
| | #2 |
|
That should be like this Code: void main()
{
TRISA=0B00011111;
TRISB=0;
loop:
if (PORTA.0==0) { PORTB.0=1; }
else {PORTB.0=0; }
goto loop;
}
Last edited by be80be; 2nd June 2009 at 07:20 PM. | |
| |
| | #3 |
|
Welcome to the forums. You will need a little bit more code than that in order to make a successful program. What language are you using? It would be worth looking at Nigel's site WinPicProg Page. He has some very good tutorials that explain how to wire up the hardware. He also uses a more up-to-date PIC that is still produced. | |
| |
| | #4 |
|
i want the circuit not the code plz because i want to make it and the code is not a problem | |
| |
| | #5 |
|
Any of the following will help you: Nigel's PIC Tutorial Switch Board PIC Tutorial PIC Tutorial Have a read and come back with some specific questions. Do you have any parts and a breadboard to practise with?
__________________ Private messages are for personal communication, please do not use them to ask for help. | |
| |
| | #6 |
|
does there is more simple circuits
| |
| |
| | #7 |
|
What's the problem with the circuit? Hook the switch up to the input line, and the led to the output line...
__________________ "Because I be what I be. I would tell you what you want to know if I could, mum, but I be a cat, and no cat anywhere ever gave anyone a straight answer, har har." | |
| |
| | #8 |
|
Killer you don't check to see if PORTA.F0 there isn't a port like that on a pic Here this should get you started | |
| |
| | #9 |
|
be8, I did a quick google search there is PIC code out there that refers to the ports exactly as he did.. Might be the compiler.
__________________ "Because I be what I be. I would tell you what you want to know if I could, mum, but I be a cat, and no cat anywhere ever gave anyone a straight answer, har har." | |
| |
| | #10 |
|
thanxxxxxxxxxxxxxxxxxxxxxxx every one | |
| |
| | #11 |
|
There some things I haven't tried. mikroC thats it.
| |
| |
|
| Tags |
| 16f84a, pic |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| H e l p me please :S Relay 16f84a | tred13 | Electronic Projects Design/Ideas/Reviews | 3 | 22nd November 2008 10:27 AM |
| C++ in PIC 16f84a | sheng_james | Micro Controllers | 6 | 12th January 2008 07:53 AM |
| PIC 16f84A problem | prasanna_km | Electronic Projects Design/Ideas/Reviews | 4 | 26th May 2005 06:01 PM |
| 16F84A urgent | iceman83 | Micro Controllers | 4 | 8th April 2005 10:23 AM |
| HELP with 16f84a i2c | PIC Dummy | Micro Controllers | 0 | 20th February 2004 05:59 PM |