main.c 430 字节
Newer Older
G
guozhanxin 已提交
1 2 3 4 5 6 7
/**
 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <rtthread.h>
8
#include <rtdevice.h>
G
guozhanxin 已提交
9

10
#define LED_PIN 25
G
guozhanxin 已提交
11

12 13
int main(void)
{
G
guozhanxin 已提交
14 15
    rt_kprintf("Hello, RT-Thread!\n");

16 17 18 19 20
    rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);

    while (1)
    {
        rt_pin_write(LED_PIN, 1);
G
guozhanxin 已提交
21
        rt_thread_mdelay(1000);
22
        rt_pin_write(LED_PIN, 0);
G
guozhanxin 已提交
23 24 25 26
        rt_thread_mdelay(1000);
    }
}