Final Project / Mbed 2 deprecated Remote-Control_PID

Dependencies:   mbed Adafruit_GFX

Committer:
21400688
Date:
Sat Jun 15 20:39:39 2019 +0000
Revision:
0:c4c874d702f9
first commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
21400688 0:c4c874d702f9 1 /* Copyright (c) 2012 cstyles, MIT License
21400688 0:c4c874d702f9 2 *
21400688 0:c4c874d702f9 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
21400688 0:c4c874d702f9 4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
21400688 0:c4c874d702f9 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
21400688 0:c4c874d702f9 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
21400688 0:c4c874d702f9 7 * furnished to do so, subject to the following conditions:
21400688 0:c4c874d702f9 8 *
21400688 0:c4c874d702f9 9 * The above copyright notice and this permission notice shall be included in all copies or
21400688 0:c4c874d702f9 10 * substantial portions of the Software.
21400688 0:c4c874d702f9 11 *
21400688 0:c4c874d702f9 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
21400688 0:c4c874d702f9 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21400688 0:c4c874d702f9 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21400688 0:c4c874d702f9 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21400688 0:c4c874d702f9 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21400688 0:c4c874d702f9 17 */
21400688 0:c4c874d702f9 18
21400688 0:c4c874d702f9 19 #ifndef PixelArray_H
21400688 0:c4c874d702f9 20 #define PixelArray_H
21400688 0:c4c874d702f9 21
21400688 0:c4c874d702f9 22 #include "mbed.h"
21400688 0:c4c874d702f9 23
21400688 0:c4c874d702f9 24 //!Library for the WS2812 RGB LED with integrated controller
21400688 0:c4c874d702f9 25 /*!
21400688 0:c4c874d702f9 26 PixelArray
21400688 0:c4c874d702f9 27 */
21400688 0:c4c874d702f9 28 class PixelArray
21400688 0:c4c874d702f9 29 {
21400688 0:c4c874d702f9 30 public:
21400688 0:c4c874d702f9 31 //!Creates an instance of the class.
21400688 0:c4c874d702f9 32 /*!
21400688 0:c4c874d702f9 33 Pixel Array
21400688 0:c4c874d702f9 34 */
21400688 0:c4c874d702f9 35 PixelArray(int);
21400688 0:c4c874d702f9 36
21400688 0:c4c874d702f9 37 /*!
21400688 0:c4c874d702f9 38 Destroys instance.
21400688 0:c4c874d702f9 39 */
21400688 0:c4c874d702f9 40 ~PixelArray();
21400688 0:c4c874d702f9 41
21400688 0:c4c874d702f9 42 int* getBuf();
21400688 0:c4c874d702f9 43
21400688 0:c4c874d702f9 44 void SetAll(unsigned int);
21400688 0:c4c874d702f9 45 void SetAllI(unsigned char);
21400688 0:c4c874d702f9 46 void SetAllR(unsigned char);
21400688 0:c4c874d702f9 47 void SetAllG(unsigned char);
21400688 0:c4c874d702f9 48 void SetAllB(unsigned char);
21400688 0:c4c874d702f9 49
21400688 0:c4c874d702f9 50 // location, value
21400688 0:c4c874d702f9 51 void Set(int, unsigned int);
21400688 0:c4c874d702f9 52 void SetI(int, unsigned char);
21400688 0:c4c874d702f9 53 void SetR(int, unsigned char);
21400688 0:c4c874d702f9 54 void SetG(int, unsigned char);
21400688 0:c4c874d702f9 55 void SetB(int, unsigned char);
21400688 0:c4c874d702f9 56
21400688 0:c4c874d702f9 57 private:
21400688 0:c4c874d702f9 58
21400688 0:c4c874d702f9 59 int *pbuf;
21400688 0:c4c874d702f9 60 int pbufsize;
21400688 0:c4c874d702f9 61
21400688 0:c4c874d702f9 62 void __set_pixel_component(int index, int channel, int value);
21400688 0:c4c874d702f9 63 void __set_pixel(int index, int value);
21400688 0:c4c874d702f9 64
21400688 0:c4c874d702f9 65 };
21400688 0:c4c874d702f9 66
21400688 0:c4c874d702f9 67 #endif
21400688 0:c4c874d702f9 68