MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
Macros
MeRGBLed.cpp File Reference

Driver for W2812 full-color LED lights. More...

`#include "MeRGBLed.h"`
Include dependency graph for MeRGBLed.cpp:

## Macros
#define | w_zeropulse (350)
#define | w_onepulse (900)
#define | w_totalperiod (1250)
#define | w_fixedlow (3)
#define | w_fixedhigh (6)
#define | w_fixedtotal (10)
#define | w_zerocycles ( ( (F_CPU / 1000) * w_zeropulse) / 1000000)
#define | w_onecycles ( ( (F_CPU / 1000) * w_onepulse + 500000) / 1000000)
#define | w_totalcycles ( ( (F_CPU / 1000) * w_totalperiod + 500000) / 1000000)
#define | w1 (w_zerocycles - w_fixedlow)
#define | w2 (w_onecycles - w_fixedhigh - w1)
#define | w3 (w_totalcycles - w_fixedtotal - w1 - w2)
#define | w1_nops 0
#define | w_lowtime ( (w1_nops + w_fixedlow) * 1000000) / (F_CPU / 1000)
#define | w2_nops 0
#define | w3_nops 0
#define | w_nop1 "nop \n\t"
#define | w_nop2 "rjmp .+0 \n\t"
#define | w_nop4 w_nop2 w_nop2
#define | w_nop8 w_nop4 w_nop4
#define | w_nop16 w_nop8 w_nop8

## Detailed Description

Driver for W2812 full-color LED lights.

Author
  MakeBlock

Version
  V1.0.2

Date
  2017/06/23

Copyright
  This software is Copyright (C), 2014-2018, MakeBlock. Use is subject to license
  conditions. The main licensing options available are GPL V2 or Commercial:

Open Source Licensing GPL V2
  This is the appropriate option if you want to share the source code of your
  application with everyone you distribute it to, and you also want to give them
  the right to share who uses it. If you wish to use this software under Open
  Source Licensing, you must contribute all your source code to the open source
  community in accordance with the GPL Version 2 when your application is
  distributed. See http://www.gnu.org/copyleft/gpl.html

Description
  This file is a drive for WS2811/2812 full-color LED lights, It supports W2812B full-color LED lights device provided by the MakeBlock.

Method List:

1. void MeRGBLed::reset(uint8_t port)
2. void MeRGBLed::reset(uint8_t port,uint8_t slot)
3. void MeRGBLed::setpin(uint8_t port)
4. uint8_t MeRGBLed::getNumber()
5. cRGB MeRGBLed::getColorAt(uint8_t index)
6. void MeRGBLed::fillPixelsBak(uint8_t red, uint8_t green, uint8_t blue)
7. bool MeRGBLed::setColorAt(uint8_t index, uint8_t red, uint8_t green, uint8_t blue)
8. bool MeRGBLed::setColor(uint8_t index, uint8_t red, uint8_t green, uint8_t blue)
9. bool MeRGBLed::setColor(uint8_t red, uint8_t green, uint8_t blue)
10. bool MeRGBLed::setColor(uint8_t index, long value)
11. void MeRGBLed::show()

History:

      `<Author>`         `<Time>`        `<Version>`        `<Descr>`
      Mark Yan         2015/09/01     1.0.0            Rebuild the old lib.
      Scott            2016/09/20     1.0.1            Add a delay.
      Mark Yan         2017/06/23     1.0.2            Add function fillPixelsBak.