Skip to content

Commit

Permalink
Delimit sections with comments
Browse files Browse the repository at this point in the history
The Arduino Makefile does not support multiple ino
files (sudar/Arduino-Makefile#49), and I'm
not familiar enough with C/C++ to break things out into separate
c/cpp/header files.  For now, I'm sticking with this.

Signed-off-by: Hugh Brown (Saint Aardvark the Carpeted) <aardvark@saintaardvarkthecarpeted.com>
  • Loading branch information
saintaardvark committed Sep 10, 2021
1 parent 2fe5d96 commit 659e8e5
Showing 1 changed file with 70 additions and 2 deletions.
72 changes: 70 additions & 2 deletions transmitter/transmitter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
#include <SPI.h>
#include <Adafruit_Sensor.h>

/*
The Arduino Makefile does not support multiple ino
files (https://github.com/sudar/Arduino-Makefile/issues/49), and I'm
not familiar enough with C/C++ to break things out into separate
c/cpp/header files. For now, I'm sticking with this.
*/

/*
Format of message:
{Temp: 19.30 C}
Expand All @@ -29,7 +36,12 @@
*/
#define MAX_PAYLOAD_LEN 66

/* Uncomment if you have a BMP sensor */
/*
******************
BMP sensor begin
******************
*/

#define HAVE_BMP 1

# ifdef HAVE_BMP
Expand All @@ -41,8 +53,34 @@ Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);
sensors_event_t event;
#endif /* HAVE_BMP */

/*
**************
BMP sensor end
**************
*/

/*
**************************
Precipitation sensor begin
**************************
*/

/* Uncomment if you have precip sensor */
#define HAVE_PRECIP 1
#define PRECIP_PIN A0

/*
************************
Precipitation sensor end
************************
*/

/*
*************************
Precipitation meter begin
*************************
*/


/* Uncomment if you have a precipitation *meter* */
#define HAVE_PRCPMTR 1
Expand All @@ -64,6 +102,18 @@ void PrcpMtrISR() {

#endif

/*
***********************
Precipitation meter end
***********************
*/

/*
*******************
1wire sensor begin
*******************
*/

/* Uncomment if you have the temperature sensors. */
#define HAVE_1WIRE_TEMP_SENSORS 1

Expand Down Expand Up @@ -119,6 +169,18 @@ void discoverOneWireDevices(void) {
}
#endif /* HAVE_1WIRE_TEMP_SENSORS */

/*
****************
1wire sensor end
****************
*/

/*
****************
DHT sensor begin
****************
*/

// Humidity sensor
#include "DHT.h"

Expand All @@ -130,8 +192,14 @@ String final_msg_string;
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
DHT dht(DHTPIN, DHTTYPE);

/*
**************
DHT sensor end
**************
*/


#define LEDPIN 13
#define PRECIP_PIN A0
#define MAX_SENSORS 4

struct SensorData {
Expand Down

0 comments on commit 659e8e5

Please sign in to comment.