-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
59 lines (45 loc) · 1.08 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <pic16f877a.h> /* Pic definitions */
#include <stdbool.h> /* Bools, true of false */
#include <stdint.h> /* For uint8_t definition */
#include <stdlib.h>
#include <xc.h> /* XC8 General Include File */
#include "cristal.h"
#include "i2c.h"
#include "simon_hd44780_lcd.h"
//#include "pic16f877a.h"
#include "user.h" /* init_app */
#include "pulls.h"
#include "debug_leds.h"
#include "main.h"
#include "uart.h"
#include "timers.h"
static void test_delay(void);
static void blink_green_led(void);
void main(void)
{
init_app();
lcd_print("Hello World");
test_delay();
while (1) {
blink_green_led();
//write_uart(0x12);
pull_low_kline(50);
}
}
static void test_delay(void)
{
for (int i = 0; i < 255;i++) {
switch_prtd_led(0,1);
delay(100);
switch_prtd_led(0,0);
delay(100);
}
}
static void blink_green_led(void)
{
PORTBbits.RB1 = 1;
__delay_ms(500);
PORTBbits.RB1 = 0;
__delay_ms(500);
return;
}