Compare commits
4 Commits
f465d2852d
...
6450fadd9a
Author | SHA1 | Date |
---|---|---|
coolneng | 6450fadd9a | |
coolneng | ad84bb683f | |
coolneng | c62f482d1d | |
coolneng | 77ccf06986 |
|
@ -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