File tree Expand file tree Collapse file tree 3 files changed +88
-2
lines changed Expand file tree Collapse file tree 3 files changed +88
-2
lines changed Original file line number Diff line number Diff line change 1
- # smarthome-fw-lib-ddcommon
2
- Library with common functions for all projects
1
+ # Smarthome firmware library for ESP8266 - DDCommon
2
+ Library with common functions for all projects based on ESP8266 board
Original file line number Diff line number Diff line change
1
+ /* 1.0.0 VERSION */
2
+
3
+ #include < Arduino.h>
4
+ #include " ddcommon.h"
5
+
6
+ void writeToSerial (String msg, bool nl)
7
+ {
8
+ if (SERIAL_ENABLED)
9
+ {
10
+ Serial.print (msg);
11
+ if (nl)
12
+ Serial.println ();
13
+ }
14
+ }
15
+
16
+ void writeToSerial (const char *msg, bool nl)
17
+ {
18
+ if (SERIAL_ENABLED)
19
+ {
20
+ Serial.print (msg);
21
+ if (nl)
22
+ Serial.println ();
23
+ }
24
+ }
25
+
26
+ void writeToSerial (float msg, bool nl)
27
+ {
28
+ if (SERIAL_ENABLED)
29
+ {
30
+ Serial.print (msg);
31
+ if (nl)
32
+ Serial.println ();
33
+ }
34
+ }
35
+
36
+ void writeToSerial (int msg, bool nl)
37
+ {
38
+ if (SERIAL_ENABLED)
39
+ {
40
+ Serial.print (msg);
41
+ if (nl)
42
+ Serial.println ();
43
+ }
44
+ }
45
+
46
+ void writeToSerial (unsigned int msg, bool nl)
47
+ {
48
+ if (SERIAL_ENABLED)
49
+ {
50
+ Serial.print (msg);
51
+ if (nl)
52
+ Serial.println ();
53
+ }
54
+ }
55
+
56
+ void writeToSerial (double msg, bool nl)
57
+ {
58
+ if (SERIAL_ENABLED)
59
+ {
60
+ Serial.print (msg);
61
+ if (nl)
62
+ Serial.println ();
63
+ }
64
+ }
Original file line number Diff line number Diff line change
1
+ /* 1.0.0 VERSION */
2
+
3
+ #ifndef ddcommon_h
4
+ #define ddcommon_h
5
+
6
+ #include <Arduino.h>
7
+
8
+ #define SERIAL_ENABLED false
9
+
10
+ void writeToSerial (String , bool );
11
+
12
+ void writeToSerial (const char * , bool );
13
+
14
+ void writeToSerial (float , bool );
15
+
16
+ void writeToSerial (int , bool );
17
+
18
+ void writeToSerial (unsigned int , bool );
19
+
20
+ void writeToSerial (double , bool );
21
+
22
+ #endif
You can’t perform that action at this time.
0 commit comments