upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
groveledbar.h
1 /*
2  * Author: Jon Trulson <jtrulson@ics.com>
3  * Copyright (c) 2016 Intel Corporation.
4  *
5  * These modules were rewritten, based on original work by:
6  *
7  * (original my9221/groveledbar)
8  * Author: Yevgeniy Kiveisha <yevgeniy.kiveisha@intel.com>
9  * Copyright (c) 2014 Intel Corporation.
10  *
11  * (grovecircularled)
12  * Author: Jun Kato and Yevgeniy Kiveisha <yevgeniy.kiveisha@intel.com>
13  * Contributions: Jon Trulson <jtrulson@ics.com>
14  * Copyright (c) 2014 Intel Corporation.
15  *
16  * Permission is hereby granted, free of charge, to any person obtaining
17  * a copy of this software and associated documentation files (the
18  * "Software"), to deal in the Software without restriction, including
19  * without limitation the rights to use, copy, modify, merge, publish,
20  * distribute, sublicense, and/or sell copies of the Software, and to
21  * permit persons to whom the Software is furnished to do so, subject to
22  * the following conditions:
23  *
24  * The above copyright notice and this permission notice shall be
25  * included in all copies or substantial portions of the Software.
26  *
27  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
31  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
32  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
33  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34  */
35 #pragma once
36 
37 #include <string>
38 #include <mraa/common.hpp>
39 #include <mraa/gpio.hpp>
40 
41 #include "my9221.h"
42 
43 namespace upm {
44 
66  class GroveLEDBar : public MY9221 {
67  public:
68 
76  GroveLEDBar(uint8_t dataPin, uint8_t clockPin, int instances=1);
77 
81  ~GroveLEDBar();
82 
93  void setBarLevel(uint8_t level, bool greenToRed=true, int barNumber=0);
94 
95  protected:
96  private:
97  };
98 
99 }
Definition: my9221.h:48
void setBarLevel(uint8_t level, bool greenToRed=true, int barNumber=0)
Definition: groveledbar.cxx:59
GroveLEDBar(uint8_t dataPin, uint8_t clockPin, int instances=1)
Definition: groveledbar.cxx:47
API for Grove LED Bars base on the MY9221.
Definition: groveledbar.h:66
~GroveLEDBar()
Definition: groveledbar.cxx:55