main.c 666 字节
Newer Older
T
thread-liu 已提交
1 2 3 4 5 6 7 8 9
/*
 * Copyright (c) 2006-2018, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-06-05     thread-liu   first version
 */
T
thread-liu 已提交
10

T
thread-liu 已提交
11 12 13 14
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>

T
thread-liu 已提交
15 16
/* defined the LD7 pin: PH7 */
#define LED7_PIN    GET_PIN(H, 7)
T
thread-liu 已提交
17 18 19 20

int main(void) 
{
    int count = 1;
T
thread-liu 已提交
21 22
    /* set LD7 pin mode to output */
    rt_pin_mode(LED7_PIN, PIN_MODE_OUTPUT);
T
thread-liu 已提交
23 24 25
    
    while (count++)
    {
T
thread-liu 已提交
26
        rt_pin_write(LED7_PIN, PIN_HIGH);
T
thread-liu 已提交
27
        rt_thread_mdelay(500);    
T
thread-liu 已提交
28
        rt_pin_write(LED7_PIN, PIN_LOW);
T
thread-liu 已提交
29 30 31 32 33
        rt_thread_mdelay(500);
    }
    
    return RT_EOK;
}