i have many question here
1)your program(LED) can compile in C++ language??i have try compile in C++ but have error occur(unknown pragma & Cannot open include file: 'p18f1320.h')if not C++,then can you show the step how to compile it
The program is specific to a PIC18F1320. You can use MPLAB and C18 to compile the program. For now use the simulator to execute it DEBUG>SELECT_TOOL>SIMULATOR.
2)what's the function of Oscillator selection,watchdog timer,low voltage ICSP
This is all explained in the processor data sheet. For now you can use what I provided because it works. I have to skip over (explain latter) some details or the tutorial would be too long to be useful.
3)is it the ADCON1 = 0x7F is fixed..can i change ADCON2 and what's mean 0x7F and why we need convert RA0 to digital
Again to run the tutorial use the line ADCON1=0x7F. We will use this line in every program till we get to the tutorial on analog input, then we will need to change it. Do not expect the first tutorial to teach you everything you will ever need to know.
4)if we want turn LED on isit must need the 2 step
TRISA = 0b10111110; why is this value,can i change to other value
PORTA = 0b00000001; the bit0 is 1, mean turn on LED bit0?
The LEDs on the Junebug are charlieplexed. See JPUG#1 on the blueroomElectronics site for detailed info but for now. The TRISA make all bits of A inputs, execpt bit 0 and bit 6 which are outputs. The PORTA make PORTA bit 0 high (+5V) and PORTA bit 6 low (0V). The led connected between bit 0 and bit 6 will light. There are actualy 2 leds between them but only the one with its annod connect to PORTA bit 0 will come on. There is a correct value for TRISA and PORTA that will turn on each of the six LEDs. For this tutorial I just want to turn on one without knowing how and why charlieplexing works. That is why it is not explained.
5)#pragma
isit tell compiler what value of PIC we use like PIC18F1320