Giter Club home page Giter Club logo

lunar_calendar's Introduction

lunar_calendar

1、介绍

lunar_calendar 是一个将公历日期转换成阴历的工具软件包。

1.1 目录结构

名称 说明
examples 例子目录
inc 头文件目录
src 源代码目录

1.2 许可证

lunar_calendar 软件包使用 MIT 软件包许可协议,请见 lunar_calendar/LICENSE 文件。

1.3 依赖

  • RT-Thread 3.0+

2、如何打开 lunar_calendar

使用 lunar_calendar package 需要在 RT-Thread 的包管理器中选择它,具体路径如下:

RT-Thread online packages
    tools packages --->
        [*] lunar_calendar: A tool to convert a Gregorian calendar date into a lunar calendar.

然后让 RT-Thread 的包管理器自动更新,或者使用 pkgs --update 命令更新包到 BSP 中。

3、使用 lunar_calendar

在使用 lunar_calendar 软件包时首先要定义一个char数组来存储返回的阴历汉字,如:

char str[32] = {'\0'};

调用的函数接口为:

void sun2lunar(int year, int month, int day, char *str_lunar);

比如:

static showlunar(int argc, char const *argv[]) {
    if (argc == 4) {
        char str[32] = {'\0'};
        sun2lunar(atoi(argv[1]), atoi(argv[2]), atoi(argv[3]), str);
        printf("%s\n", str);
    }
    return 0;
}

4、示例演示

在 MSH 中输入命令 showlunar 2019 12 4,可以在串口助手上看到输出了对应日期的阴历。

msh >showlunar 2019 12 4
冬月初九
msh >

5、注意事项

  • 当前可以生成阴历日期对应的阳历范围为 1900-1-1 到2099-12-31。

6、联系方式 & 感谢

lunar_calendar's People

Contributors

illusionlee avatar

Stargazers

Chen Zhicheng avatar Principle avatar  avatar Larrie/Leon avatar Soky avatar  avatar TridentTD avatar Lewis He avatar dengyong825 avatar Billy Liu avatar  avatar Ghazigq avatar

Watchers

 avatar

lunar_calendar's Issues

删除对于rt-thread头文件的引用

您好,代码文件lunar_calendar.c中只使用了标准库的函数,并未使用任何rt-thread相关的函数,因此能否移除对rt-thread头文件的引用,方便仓库直接作为子仓库引用到其他的项目中,谢谢。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.