Compare commits
4 Commits
6450fadd9a
...
f465d2852d
Author | SHA1 | Date |
---|---|---|
coolneng | f465d2852d | |
coolneng | 1853ecca00 | |
coolneng | 89b3ec1889 | |
coolneng | 043753df16 |
|
@ -0,0 +1,2 @@
|
||||||
|
CompileFlags:
|
||||||
|
Remove: [-mlongcalls, -free, -mtext-section-literals, -fipa-pta]
|
22
src/main.cpp
22
src/main.cpp
|
@ -1,9 +1,25 @@
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <DHT.h>
|
#include <DHT.h>
|
||||||
|
|
||||||
void setup() { Serial.begin(9600); }
|
#define DHTTYPE DHT11
|
||||||
|
#define DHTPIN 4
|
||||||
|
|
||||||
|
DHT dht(DHTPIN, DHTTYPE);
|
||||||
|
|
||||||
|
int fc28_pin = A0;
|
||||||
|
int soil_threshold = 40;
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
Serial.begin(9600);
|
||||||
|
dht.begin();
|
||||||
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
Serial.println("Sup dude");
|
char buffer[200];
|
||||||
delay(1000);
|
int analog_val = analogRead(fc28_pin);
|
||||||
|
int soil_percentage = map(analog_val, 0, 1023, 0, 100);
|
||||||
|
sprintf(buffer, "Temperature: %.2f°C Humidity: %.2f%% Soil humidity: %i%%",
|
||||||
|
dht.readTemperature(), dht.readHumidity(), soil_percentage);
|
||||||
|
Serial.println(buffer);
|
||||||
|
delay(30000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue