Skip to content

Instantly share code, notes, and snippets.

View vikrant2mahajan's full-sized avatar

Vikrant Mahajan vikrant2mahajan

View GitHub Profile
@vikrant2mahajan
vikrant2mahajan / gist:bda30c0ab0164a6a6ae2fd4b0a198ead
Created February 12, 2017 16:05
Nodemcu ESP 8266 Wifi Switch code using Arduino
/*
* This sketch demonstrates how to set up a simple HTTP-like server.
* The server will set a GPIO pin depending on the request
* http://server_ip/gpio/0 will set the GPIO2 low,
* http://server_ip/gpio/1 will set the GPIO2 high
* server_ip is the IP address of the ESP8266 module, will be
* printed to Serial when the module is connected.
*/
#include <ESP8266WiFi.h>
@vikrant2mahajan
vikrant2mahajan / esp8266-lcd-1602a-temperature-sensor-dht11
Last active January 6, 2024 21:50
Connect an LCD 1602A with ESP8266 along with DHT11 temperature sensor
/*
DHT Weather server with display integrated for NodeMCU esp8266 and 1602A LCD
Please connect 1602A using I2C backpack.
If you feel display is not showing anything, please take a screwdriver and update contrast
using I2C potentiometer in back of LCD
LCD config
SDA pin - D2
SCL pin - D1
@vikrant2mahajan
vikrant2mahajan / Angular Sanitize HTML Filter
Last active August 28, 2020 10:08
Angular sanitize safe HTML filter to user with angular ng-bind-html
filter('trust', ['$sce',function($sce) {
return function(value, type) {
return $sce.trustAs(type || 'html', value);
}
}]);
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;