-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d0888d
commit ed58cfb
Showing
3 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# smarthome-fw-lib-ddcommon | ||
Library with common functions for all projects | ||
# Smarthome firmware library for ESP8266 - DDCommon | ||
Library with common functions for all projects based on ESP8266 board |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* 1.0.0 VERSION */ | ||
|
||
#include <Arduino.h> | ||
#include "ddcommon.h" | ||
|
||
void writeToSerial(String msg, bool nl) | ||
{ | ||
if (SERIAL_ENABLED) | ||
{ | ||
Serial.print(msg); | ||
if (nl) | ||
Serial.println(); | ||
} | ||
} | ||
|
||
void writeToSerial(const char *msg, bool nl) | ||
{ | ||
if (SERIAL_ENABLED) | ||
{ | ||
Serial.print(msg); | ||
if (nl) | ||
Serial.println(); | ||
} | ||
} | ||
|
||
void writeToSerial(float msg, bool nl) | ||
{ | ||
if (SERIAL_ENABLED) | ||
{ | ||
Serial.print(msg); | ||
if (nl) | ||
Serial.println(); | ||
} | ||
} | ||
|
||
void writeToSerial(int msg, bool nl) | ||
{ | ||
if (SERIAL_ENABLED) | ||
{ | ||
Serial.print(msg); | ||
if (nl) | ||
Serial.println(); | ||
} | ||
} | ||
|
||
void writeToSerial(unsigned int msg, bool nl) | ||
{ | ||
if (SERIAL_ENABLED) | ||
{ | ||
Serial.print(msg); | ||
if (nl) | ||
Serial.println(); | ||
} | ||
} | ||
|
||
void writeToSerial(double msg, bool nl) | ||
{ | ||
if (SERIAL_ENABLED) | ||
{ | ||
Serial.print(msg); | ||
if (nl) | ||
Serial.println(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* 1.0.0 VERSION */ | ||
|
||
#ifndef ddcommon_h | ||
#define ddcommon_h | ||
|
||
#include <Arduino.h> | ||
|
||
#define SERIAL_ENABLED false | ||
|
||
void writeToSerial(String, bool); | ||
|
||
void writeToSerial(const char *, bool); | ||
|
||
void writeToSerial(float, bool); | ||
|
||
void writeToSerial(int, bool); | ||
|
||
void writeToSerial(unsigned int, bool); | ||
|
||
void writeToSerial(double, bool); | ||
|
||
#endif |