DanT29
Newbie level 4
- Joined
- Jul 5, 2011
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,345
Hey guys I'm new PIC microcontrollers and programming them in C. I started many months ago but had to stop since school started and I got busy with other things. But now I'm back to it determined to learn and I really need your help guys. I have a small issue in my program and I was wondering if you guys can help! I have an issue with the delay function...I'm not sure what to use for it. This is a newbie issue and I know you guys can help. I hope I don't need to make my own library for it.
I'm trying to make an led blink this is what I'm using:
MPLAB X
HI-TECH C complier
PIC KIT 2
PIC 16F628a
Here's my code:
I tried a lot of functions but none worked. I appreciate the help!
I'm trying to make an led blink this is what I'm using:
MPLAB X
HI-TECH C complier
PIC KIT 2
PIC 16F628a
Here's my code:
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 #include<pic.h> #include<htc.h> void main(){ TRISB=0x00; PORTB=0x00; while(1){ PORTB=~PORTB; __delay_ms(1000); PORTB=~PORTB; } }
I tried a lot of functions but none worked. I appreciate the help!
Last edited by a moderator: