Skip to content

Instantly share code, notes, and snippets.

@elktros
elktros / ESP32-BMP180-I2C-LCD.ino
Created Mar 29, 2021
Code for ESP32 BMP180 I2C LCD.
View ESP32-BMP180-I2C-LCD.ino
#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 Mar 29, 2021
ESP32 BM180 Sensor with Serial Output.
View ESP32-BMP180-Serial.ino
#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 Mar 29, 2021
CMakeLists text file for Raspberry Pi Pico New Project.
View Raspberry-Pi-Pico-New-Project-CMakeLists.txt
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 Mar 29, 2021
Test C Code for Raspberry Pi Pico New Project.
View Raspberry-Pi-Pico-New-Project.c
#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 Mar 27, 2021
Code for Interfacing DHT11 with ESP32 and displaying result on I2C LCD.
View ESP32-DHT11-I2C-LCD.ino
#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 Mar 27, 2021
Code for ESP32 DHT11 Serial Output.
View ESP32-DHT11-Serial.ino
#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 Mar 27, 2021
Code for ESP32 DS18B20 with I2C LCD.
View ESP32-DS18B20-I2C-LCD.ino
#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 Mar 27, 2021
Code for ESP32 DS18B20 Interface with results on Serial.
View ESP32-DS18B20-Serial.ino
#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 Mar 24, 2021
ESP32 BLE Server for connecting with Smartphone.
View ESP32-BLE-Server-Smartphone.ino
#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"
View ESP32-BLE-Client.ino
#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;