Coder Social home page Coder Social logo

dyyt587 / dled Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 92 KB

This is a simple to use led flicker library, it can not only easily complete the fast flashing slow flashing lights but also can be used for other tasks that need to be completed periodically, such as buzzers, industrial lines, etc

License: MIT License

CMake 10.82% C 89.18%

dled's Introduction

dled

This is a simple to use led flicker or other production line library.

It can not only easily complete the fast flashing slow flashing lights but also can be used for other tasks that need to be completed periodically, such as buzzers, industrial lines, etc

usage

first: create led/actuator

//create low level operation
void updata(dled_t *led) {
    printf("%s ", led->name);
    printf("color:%d \n", led->color);
}
//create actuator
dled_t led = {
        .name="led0", 
        .color=0xff,
        .updata=updata,
        .userdata=0,
};

second: create task sequence

the TASK_END must have and in the end

dled_task_t task[] = {
        {.color=10, .delayTime=500},
        {.color=02, .delayTime=400},
        {.color=03, .delayTime=300},
        {.color=04, .delayTime=100},
        TASK_END
};

third: link task to dled's control and Recursive call led_handle();

    led_create_task(&led, task, 2);

    while (1) {
        led_handle();
    }

Good job,enjoy youself.

dled's People

Contributors

dyyt587 avatar

Stargazers

wocmuch avatar  avatar

Watchers

 avatar

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.