Right, I got a PICkit 2 yesterday (16F690), and I was messing around with the sample programs, but I decided that I'm going to use C to program it because I couldnt get my head around whatever is in the samples (I think it's assembly?)
Anyway, I have a few question for my "Hello World" program.
1)What should I have in the header?
2)How do I declare an output or input pin?
3)How do I set a pin to either on or off?
This is my Hello World program so far
Of course, I'm sure most of it is a load of... incorrect programming...
It makes all the LEDs light up, which is a start!
I'm sorry if this has been answered before, but I did look and couldn't find anything.
Oh, and I have looked at numerous tutorials, but a lot of them are outdated or for a different chip.
Thanks very much!
Anyway, I have a few question for my "Hello World" program.
1)What should I have in the header?
2)How do I declare an output or input pin?
3)How do I set a pin to either on or off?
This is my Hello World program so far
Rich (BB code):
#include "pic16F690.h"
main()
{
TRISC=0;
again:
PORTC,1;
goto again;
}
It makes all the LEDs light up, which is a start!
I'm sorry if this has been answered before, but I did look and couldn't find anything.
Oh, and I have looked at numerous tutorials, but a lot of them are outdated or for a different chip.
Thanks very much!