#define THINGER_SERIAL_DEBUG
#include
#define username "dinaalfaruq"
#define device_id "IoT1"
#define credential "12345678"
#include "DHTesp.h"
const int DHT_PIN = 15;
DHTesp dhtSensor;
#define SSID "Wokwi-GUEST"
#define password ""
#define Lampu 21
#define trig 13
#define echo 12
ThingerESP32 thing(username, device_id,credential);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
pinMode(Lampu, OUTPUT);
thing.add_wifi(SSID,password);
thing["Lampu"]<>[](pson& out)
{
digitalWrite(trig, HIGH);
delayMicroseconds(1000);
digitalWrite(trig, LOW);
Serial.begin(115200);
dhtSensor.setup(DHT_PIN, DHTesp::DHT22);
long waktu = pulseIn(echo,HIGH);
double jarak = waktu/58;
out = jarak;
};
}
void loop() {
// put your main code here, to run repeatedly:
thing.handle();
TempAndHumidity data = dhtSensor.getTempAndHumidity();
Serial.println("Temp: " + String(data.temperature, 2) + "°C");
Serial.println("Humidity: " + String(data.humidity, 1) + "%");
Serial.println("---");
delay(1000);
}
MGMP Matematika MA
Kegiatan PJJ MGMP Matematika MA Kab. Bondowoso
GESS 2019
BERSAMA GURU IGI
MGMP MIPA MTs. ZA
Penelitian MIPA (pengukuran dan SAINS) langsung ke lahan Pertanian Dinas Pertanian Kabupaten Bondowoso di Desa Lojajar.
STEM CAMP SEAQITEP IN MATH
BERSAMA PROf. KUMANO YOSHIZUKE, P.hD SHIZUOKA UNIVERSITY
ANUGRAH GURU INDONESIA IGI
BERSAMA BAPAK ABD KARIM, BAPAK ARIES SAMISANOV JUGA BERSAMA IBU DEPUTI GURBENUR JABAR
Kegiatan Madrasah
BERSAMA KEPALA MA, REKAN GURU, SISWA DAN MAHASISWA MAGANG
September 24, 2022
September 21, 2022
September 17, 2022
PELATIHAN INTERNET OF THING (IoT) SEAMOLEC (4 LED DENGAN 1 BUTTON)
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(2, INPUT);
pinMode(23, OUTPUT);
pinMode(22, OUTPUT);
pinMode(19, OUTPUT);
pinMode(18, OUTPUT);
Serial.println("Hello, ESP32!");
}
int on_off = 0;
void loop() {
// put your main code here, to run repeatedly:
int nilai = digitalRead(2);
//Serial.println(nilai);
if(nilai == 1) {
on_off++;
Serial.println(on_off);
if (on_off == 1) {
digitalWrite(23, HIGH);
digitalWrite(22, HIGH);
digitalWrite(19, HIGH);
digitalWrite(18, HIGH);
}else if (on_off ==2){
digitalWrite(23, LOW);
digitalWrite(22, LOW);
digitalWrite(19, LOW);
digitalWrite(18, LOW);
}
else {
digitalWrite(23, LOW);
digitalWrite(22, LOW);
digitalWrite(19, LOW);
digitalWrite(18, LOW);
on_off = 0;
}
}
//delay(1000); // this speeds up the simulation
}