1 | /*
|
---|
2 | ****************************************************************************
|
---|
3 | * This file is part of Arduino Lucky Shield Library
|
---|
4 | *
|
---|
5 | * Copyright (c) 2016 Arduino srl. All right reserved.
|
---|
6 | *
|
---|
7 | * File : Lucky.h
|
---|
8 | * Date : 2016/03/21
|
---|
9 | * Revision : 0.0.1 $
|
---|
10 | * Author: andrea[at]arduino[dot]org
|
---|
11 | *
|
---|
12 | ****************************************************************************
|
---|
13 |
|
---|
14 | This library is free software; you can redistribute it and/or
|
---|
15 | modify it under the terms of the GNU Lesser General Public
|
---|
16 | License as published by the Free Software Foundation; either
|
---|
17 | version 2.1 of the License, or (at your option) any later version.
|
---|
18 |
|
---|
19 | This library is distributed in the hope that it will be useful,
|
---|
20 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
22 | Lesser General Public License for more details.
|
---|
23 |
|
---|
24 | You should have received a copy of the GNU Lesser General Public
|
---|
25 | License along with this library; if not, write to the Free Software
|
---|
26 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
---|
27 |
|
---|
28 | ******************************************************************************/
|
---|
29 |
|
---|
30 | #ifndef Lucky_h
|
---|
31 | #define Lucky_h
|
---|
32 |
|
---|
33 | #include "lib/CAT9555.h"
|
---|
34 | #include "lib/MMA8491Q.h"
|
---|
35 | #include "lib/MAG3110.h"
|
---|
36 | #include "lib/BME280.h"
|
---|
37 | #include "lib/Adafruit_GFX.h"
|
---|
38 | #include "lib/Adafruit_SSD1306.h"
|
---|
39 | #include <Arduino.h>
|
---|
40 | #include "Wire.h"
|
---|
41 |
|
---|
42 | #ifdef __SAM3X8E__
|
---|
43 | #define Wire Wire1
|
---|
44 | #endif
|
---|
45 |
|
---|
46 | class Lucky
|
---|
47 | {
|
---|
48 | public:
|
---|
49 |
|
---|
50 | void begin(){
|
---|
51 | Wire.begin();
|
---|
52 | cat9555.begin();
|
---|
53 | ssd1306.begin();
|
---|
54 | mag3110.begin();
|
---|
55 | bme280.begin();
|
---|
56 | }
|
---|
57 | MMA8491Q& accelerometer(){
|
---|
58 | return mma8491q;
|
---|
59 | }
|
---|
60 | MAG3110& magnetometer(){
|
---|
61 | return mag3110;
|
---|
62 | }
|
---|
63 | BME280& environment(){
|
---|
64 | return bme280;
|
---|
65 | }
|
---|
66 | CAT9555& gpio(){
|
---|
67 | return cat9555;
|
---|
68 | }
|
---|
69 | Adafruit_SSD1306& oled(){
|
---|
70 | return ssd1306;
|
---|
71 | }
|
---|
72 | };
|
---|
73 |
|
---|
74 | extern Lucky lucky;
|
---|
75 |
|
---|
76 | #endif
|
---|