Created
May 4, 2011 10:12
-
-
Save tawashi5454/955031 to your computer and use it in GitHub Desktop.
Simple LED blink on PIC18F2420
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <p18cxxx.h> | |
#include <delays.h> | |
#pragma config OSC=HS, WDT=OFF, LVP=OFF | |
void main(void){ | |
// ポートAを出力に設定する | |
TRISA = 0; | |
// 永久に繰り返す | |
while(1){ | |
// ポートAをオンにする | |
PORTA = 0xFF; | |
// 1秒待つ | |
Delay10KTCYx(250); | |
Delay10KTCYx(250); | |
// ポートAをオフにする | |
PORTA = 0x00; | |
// 1秒待つ | |
Delay10KTCYx(250); | |
Delay10KTCYx(250); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment