Skip to content

Commit 89f67f9

Browse files
authored
Cleaned up
1 parent 379d426 commit 89f67f9

File tree

2 files changed

+2
-131
lines changed

2 files changed

+2
-131
lines changed

src/Arduino_SensorKit.cpp

Lines changed: 1 addition & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "Arduino_Sensorkit.h"
22

3-
43
//Declare component's classes
54
U8G2_SSD1306_128X64_NONAME_F_SW_I2C Oled(U8G2_R0, SCL, SDA, U8X8_PIN_NONE);
65
DHT Environment(DHTPIN, DHTTYPE);
@@ -28,118 +27,4 @@ bool SensorKit::begin(){
2827

2928
void SensorKit::end(){
3029

31-
}
32-
33-
34-
35-
36-
//Old version
37-
38-
/*
39-
// ++++++++++++++++++++++++++++++++++++++
40-
// Functions related to the Accelerometer
41-
// ++++++++++++++++++++++++++++++++++++++
42-
43-
void BreakoutBoard::init_Accelerometer(){
44-
45-
ACCELEROMETER.begin(WIRE, 0x19);
46-
delay(100);
47-
ACCELEROMETER.setFullScaleRange(LIS3DHTR_RANGE_2G);
48-
ACCELEROMETER.setOutputDataRate(LIS3DHTR_DATARATE_50HZ);
49-
Serial.println("Accelerometer Connected !");
50-
51-
}
52-
53-
float BreakoutBoard::getAccelerationValue(char axis){
54-
55-
switch(axis)
56-
{
57-
case 'X':
58-
return ACCELEROMETER.getAccelerationX();
59-
case 'Y':
60-
return ACCELEROMETER.getAccelerationY();
61-
case 'Z':
62-
return ACCELEROMETER.getAccelerationY();
63-
default :
64-
Serial.print("Invalid Input");
65-
while(1);
66-
break ;
67-
}
68-
69-
}
70-
71-
// ++++++++++++++++++++++++++++++++++++++++
72-
// Functions related to the Pressure Sensor
73-
// ++++++++++++++++++++++++++++++++++++++++
74-
75-
void BreakoutBoard::init_PressureSensor() {
76-
77-
if (!bmp280.init()) {
78-
Serial.println("Device not connected or broken!");
79-
}
80-
else {
81-
Serial.println("Pressure Sensor Connected !");
82-
}
83-
}
84-
85-
float BreakoutBoard::getPressureValue() {
86-
return bmp280.getPressure();
87-
}
88-
89-
float BreakoutBoard::getAltitudeValue() {
90-
return bmp280.calcAltitude( bmp280.getPressure());
91-
}
92-
93-
// ++++++++++++++++++++++++++++++++++++++++
94-
// Functions related to the OLED Screen
95-
// ++++++++++++++++++++++++++++++++++++++++
96-
97-
void BreakoutBoard::init_OLEDScreen(){
98-
99-
u8g2.begin();
100-
u8g2.setFont(u8g2_font_ncenB08_tr); // set a suitable font
101-
102-
}
103-
104-
void BreakoutBoard::setLabel(char *s){
105-
106-
u8g2.clearBuffer(); // clear the internal memory
107-
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
108-
u8g2.drawStr(0,10,s);
109-
//u8g2.print(a); // print random value read from pin A0
110-
u8g2.sendBuffer(); // transfer internal memory to the display
111-
delay(1000);
112-
}
113-
114-
void BreakoutBoard::setValue_float(float b){
115-
116-
u8g2.clearBuffer(); // clear the internal memory
117-
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
118-
u8g2.drawStr(0,10,"Analog Value:"); // write something to the internal memory
119-
u8g2.print(b); // print random value read from pin A0
120-
u8g2.sendBuffer(); // transfer internal memory to the display
121-
delay(1000);
122-
}
123-
124-
void BreakoutBoard::setValue_char(char c){
125-
126-
u8g2.clearBuffer(); // clear the internal memory
127-
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
128-
u8g2.drawStr(0,10,"Analog Value:"); // write something to the internal memory
129-
u8g2.print(c); // print random value read from pin A0
130-
u8g2.sendBuffer(); // transfer internal memory to the display
131-
delay(1000);
132-
133-
}
134-
135-
void BreakoutBoard::setValue_char(char c){
136-
137-
u8g2.clearBuffer(); // clear the internal memory
138-
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
139-
u8g2.drawStr(0,10,"Analog Value:"); // write something to the internal memory
140-
u8g2.print(c); // print random value read from pin A0
141-
u8g2.sendBuffer(); // transfer internal memory to the display
142-
delay(1000);
143-
144-
}
145-
*/
30+
}

src/Arduino_SensorKit.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,4 @@ extern U8G2_SSD1306_128X64_NONAME_F_SW_I2C Oled;
4040
extern SensorKit_LIS3DHTR Accelerometer;
4141
extern SensorKit_BMP280 Pressure;
4242
extern DHT Environment;
43-
#endif
44-
45-
46-
/* Not needed
47-
#define TEMP_SENSOR_PIN 3
48-
#define LED_PIN 4
49-
#define BUZZER_PIN 5
50-
#define BUTTON_PIN 6
51-
#define POT_PIN A0
52-
#define SOUND_SENSOR A2
53-
#define LIGHT_SENSOR A6
54-
#define AXIS_X X
55-
#define AXIS_Y Y
56-
#define AXIS_Z Z
57-
*/
43+
#endif

0 commit comments

Comments
 (0)