upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
groveledbar.hpp
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.hpp"
42 
43 namespace upm {
44 
66  class GroveLEDBar : public MY9221 {
67  public:
68 
76  GroveLEDBar(int dataPin, int clockPin, int instances=1);
77 
81  virtual ~GroveLEDBar();
82 
93  void setBarLevel(uint8_t level, bool greenToRed=true,
94  unsigned int barNumber=0);
95 
96  protected:
97  private:
98  };
99 
100 }
Definition: my9221.hpp:47
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
void setBarLevel(uint8_t level, bool greenToRed=true, unsigned int barNumber=0)
Definition: groveledbar.cxx:59
GroveLEDBar(int dataPin, int clockPin, int instances=1)
Definition: groveledbar.cxx:47
API for Grove LED Bars base on the MY9221.
Definition: groveledbar.hpp:66
virtual ~GroveLEDBar()
Definition: groveledbar.cxx:55