![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
This is a very simple guide, reviewing the steps required to get Blinky working on an Mbed OS platform.
Dependencies: mbed Adafruit_GFX
PixelArray.h@96:7465ab270e7a, 2019-06-13 (annotated)
- Committer:
- ParkChunMyong
- Date:
- Thu Jun 13 03:26:42 2019 +0000
- Revision:
- 96:7465ab270e7a
- Parent:
- 95:250afd53b710
first init
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ParkChunMyong | 95:250afd53b710 | 1 | /* Copyright (c) 2012 cstyles, MIT License |
ParkChunMyong | 95:250afd53b710 | 2 | * |
ParkChunMyong | 95:250afd53b710 | 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
ParkChunMyong | 95:250afd53b710 | 4 | * and associated documentation files (the "Software"), to deal in the Software without restriction, |
ParkChunMyong | 95:250afd53b710 | 5 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
ParkChunMyong | 95:250afd53b710 | 6 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
ParkChunMyong | 95:250afd53b710 | 7 | * furnished to do so, subject to the following conditions: |
ParkChunMyong | 95:250afd53b710 | 8 | * |
ParkChunMyong | 95:250afd53b710 | 9 | * The above copyright notice and this permission notice shall be included in all copies or |
ParkChunMyong | 95:250afd53b710 | 10 | * substantial portions of the Software. |
ParkChunMyong | 95:250afd53b710 | 11 | * |
ParkChunMyong | 95:250afd53b710 | 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
ParkChunMyong | 95:250afd53b710 | 13 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
ParkChunMyong | 95:250afd53b710 | 14 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
ParkChunMyong | 95:250afd53b710 | 15 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
ParkChunMyong | 95:250afd53b710 | 16 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
ParkChunMyong | 95:250afd53b710 | 17 | */ |
ParkChunMyong | 95:250afd53b710 | 18 | |
ParkChunMyong | 95:250afd53b710 | 19 | #ifndef PixelArray_H |
ParkChunMyong | 95:250afd53b710 | 20 | #define PixelArray_H |
ParkChunMyong | 95:250afd53b710 | 21 | |
ParkChunMyong | 95:250afd53b710 | 22 | #include "mbed.h" |
ParkChunMyong | 95:250afd53b710 | 23 | |
ParkChunMyong | 95:250afd53b710 | 24 | //!Library for the WS2812 RGB LED with integrated controller |
ParkChunMyong | 95:250afd53b710 | 25 | /*! |
ParkChunMyong | 95:250afd53b710 | 26 | PixelArray |
ParkChunMyong | 95:250afd53b710 | 27 | */ |
ParkChunMyong | 95:250afd53b710 | 28 | class PixelArray |
ParkChunMyong | 95:250afd53b710 | 29 | { |
ParkChunMyong | 95:250afd53b710 | 30 | public: |
ParkChunMyong | 95:250afd53b710 | 31 | //!Creates an instance of the class. |
ParkChunMyong | 95:250afd53b710 | 32 | /*! |
ParkChunMyong | 95:250afd53b710 | 33 | Pixel Array |
ParkChunMyong | 95:250afd53b710 | 34 | */ |
ParkChunMyong | 95:250afd53b710 | 35 | PixelArray(int); |
ParkChunMyong | 95:250afd53b710 | 36 | |
ParkChunMyong | 95:250afd53b710 | 37 | /*! |
ParkChunMyong | 95:250afd53b710 | 38 | Destroys instance. |
ParkChunMyong | 95:250afd53b710 | 39 | */ |
ParkChunMyong | 95:250afd53b710 | 40 | ~PixelArray(); |
ParkChunMyong | 95:250afd53b710 | 41 | |
ParkChunMyong | 95:250afd53b710 | 42 | int* getBuf(); |
ParkChunMyong | 95:250afd53b710 | 43 | |
ParkChunMyong | 95:250afd53b710 | 44 | void SetAll(unsigned int); |
ParkChunMyong | 95:250afd53b710 | 45 | void SetAllI(unsigned char); |
ParkChunMyong | 95:250afd53b710 | 46 | void SetAllR(unsigned char); |
ParkChunMyong | 95:250afd53b710 | 47 | void SetAllG(unsigned char); |
ParkChunMyong | 95:250afd53b710 | 48 | void SetAllB(unsigned char); |
ParkChunMyong | 95:250afd53b710 | 49 | |
ParkChunMyong | 95:250afd53b710 | 50 | // location, value |
ParkChunMyong | 95:250afd53b710 | 51 | void Set(int, unsigned int); |
ParkChunMyong | 95:250afd53b710 | 52 | void SetI(int, unsigned char); |
ParkChunMyong | 95:250afd53b710 | 53 | void SetR(int, unsigned char); |
ParkChunMyong | 95:250afd53b710 | 54 | void SetG(int, unsigned char); |
ParkChunMyong | 95:250afd53b710 | 55 | void SetB(int, unsigned char); |
ParkChunMyong | 95:250afd53b710 | 56 | |
ParkChunMyong | 95:250afd53b710 | 57 | private: |
ParkChunMyong | 95:250afd53b710 | 58 | |
ParkChunMyong | 95:250afd53b710 | 59 | int *pbuf; |
ParkChunMyong | 95:250afd53b710 | 60 | int pbufsize; |
ParkChunMyong | 95:250afd53b710 | 61 | |
ParkChunMyong | 95:250afd53b710 | 62 | void __set_pixel_component(int index, int channel, int value); |
ParkChunMyong | 95:250afd53b710 | 63 | void __set_pixel(int index, int value); |
ParkChunMyong | 95:250afd53b710 | 64 | |
ParkChunMyong | 95:250afd53b710 | 65 | }; |
ParkChunMyong | 95:250afd53b710 | 66 | |
ParkChunMyong | 95:250afd53b710 | 67 | #endif |
ParkChunMyong | 95:250afd53b710 | 68 | |
ParkChunMyong | 95:250afd53b710 | 69 |