Skip to content

Instantly share code, notes, and snippets.

@elktros
elktros / ESP32-BMP180-I2C-LCD.ino
Created March 29, 2021 10:34
Code for ESP32 BMP180 I2C LCD.
#include <Adafruit_BMP085.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
/Adafruit_BMP085 bmp;
LiquidCrystal_I2C lcd(0x3F, 16, 2);
byte degree_symbol[8] =
{
0b00111,
0b00101,
@elktros
elktros / ESP32-BMP180-Serial.ino
Created March 29, 2021 10:29
ESP32 BM180 Sensor with Serial Output.
#include <Adafruit_BMP085.h>
Adafruit_BMP085 bmp;;
void setup()
{
Serial.begin(115200);
if (!bmp.begin())
{
Serial.println("BMP180 Sensor not found ! ! !");
while (1)
@elktros
elktros / Raspberry-Pi-Pico-New-Project-CMakeLists.txt
Created March 29, 2021 09:44
CMakeLists text file for Raspberry Pi Pico New Project.
cmake_minimum_required(VERSION 3.13)
include(pico_sdk_import.cmake)
project(myproject_test C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
pico_sdk_init()
@elktros
elktros / Raspberry-Pi-Pico-New-Project.c
Created March 29, 2021 09:39
Test C Code for Raspberry Pi Pico New Project.
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/gpio.h"
const uint LEDPIN = 25;
int main()
{
stdio_init_all();
@elktros
elktros / ESP32-DHT11-I2C-LCD.ino
Created March 27, 2021 14:37
Code for Interfacing DHT11 with ESP32 and displaying result on I2C LCD.
#include "DHT.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define DHT11PIN 16
DHT dht(DHT11PIN, DHT11);
LiquidCrystal_I2C lcd(0x3F, 16, 2);
byte degree_symbol[8] =
@elktros
elktros / ESP32-DHT11-Serial.ino
Last active March 27, 2021 14:36
Code for ESP32 DHT11 Serial Output.
#include "DHT.h"
#define DHT11PIN 16
DHT dht(DHT11PIN, DHT11);
void setup()
{
Serial.begin(115200);
/* Start the DHT11 Sensor */
dht.begin();
@elktros
elktros / ESP32-DS18B20-I2C-LCD.ino
Created March 27, 2021 13:14
Code for ESP32 DS18B20 with I2C LCD.
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define DS18B20PIN 16
/* Create an instance of OneWire */
OneWire oneWire(DS18B20PIN);
@elktros
elktros / ESP32-DS18B20-Serial.ino
Created March 27, 2021 13:10
Code for ESP32 DS18B20 Interface with results on Serial.
#include <OneWire.h>
#include <DallasTemperature.h>
#define DS18B20PIN 16
/* Create an instance of OneWire */
OneWire oneWire(DS18B20PIN);
DallasTemperature sensor(&oneWire);
@elktros
elktros / ESP32-BLE-Server-Smartphone.ino
Created March 24, 2021 13:42
ESP32 BLE Server for connecting with Smartphone.
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
// See the following for generating UUIDs:
// https://www.uuidgenerator.net/
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"
@elktros
elktros / ESP32-BLE-Client.ino
Created March 24, 2021 13:41
ESP32 BLE Client
#include "BLEDevice.h"
/* Specify the Service UUID of Server */
static BLEUUID serviceUUID("4fafc201-1fb5-459e-8fcc-c5c9c331914b");
/* Specify the Characteristic UUID of Server */
static BLEUUID charUUID("beb5483e-36e1-4688-b7f5-ea07361b26a8");
static boolean doConnect = false;
static boolean connected = false;
static boolean doScan = false;