Compare commits

..

No commits in common. 'bf5805a12986566ca4a935c3148a74e60fee1f56' and 'bcd1694da70799e606b97a12d4c0d09ea3f207fa' have entirely different histories.

  1. 4
      Sensors/platformio.ini
  2. 37
      Sensors/src/main.cpp
  3. 6
      blink/src/main.cpp

4
Sensors/platformio.ini

@ -12,7 +12,3 @@
platform = atmelavr platform = atmelavr
board = uno board = uno
framework = arduino framework = arduino
lib_deps =
# RECOMMENDED
# Accept new functionality in a backwards compatible manner and patches
adafruit/DHT sensor library @ ^1.4.6

37
Sensors/src/main.cpp

@ -2,47 +2,10 @@
#include <Arduino.h> #include <Arduino.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
// #include <DHT_U.h>
#define DHTTYPE DHT11
#define DHTPIN 2
DHT dht(DHTPIN, DHTTYPE);
float humidity;
float tempC;
float tempF;
int setTime = 500;
void setup() { void setup() {
// put your setup code here, to run once: // put your setup code here, to run once:
Serial.begin(9600);
Serial.println("DHT11 test!");
dht.begin();
delay(setTime);
} }
void loop() { void loop() {
// put your main code here, to run repeatedly: // put your main code here, to run repeatedly:
humidity = dht.readHumidity();
tempC = dht.readTemperature();
tempF = dht.readTemperature(true);
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.print(" Temperature: ");
Serial.print(tempC);
Serial.print(" *C ");
Serial.print(tempF);
Serial.println(" *F");
delay(setTime * 2);
} }

6
blink/src/main.cpp

@ -10,8 +10,6 @@ void setup()
{ {
// initialize LED digital pin as an output. // initialize LED digital pin as an output.
pinMode(LED_BUILTIN, OUTPUT); pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
Serial.println("Hello World");
} }
void loop() void loop()
@ -19,9 +17,9 @@ void loop()
// turn the LED on (HIGH is the voltage level) // turn the LED on (HIGH is the voltage level)
digitalWrite(LED_BUILTIN, HIGH); digitalWrite(LED_BUILTIN, HIGH);
// wait for a second // wait for a second
delay(100); delay(1000);
// turn the LED off by making the voltage LOW // turn the LED off by making the voltage LOW
digitalWrite(LED_BUILTIN, LOW); digitalWrite(LED_BUILTIN, LOW);
// wait for a second // wait for a second
delay(100); delay(1000);
} }

Loading…
Cancel
Save