Skip to content

Instantly share code, notes, and snippets.

//Code to test the Gyroscope Module. Please refer circuit diagram for wiring
#include <Wire.h>
#include "DS3231.h"
RTClib RTC;
String complete_date;
String complete_time;
float sab;
const int MPU = 0x69; // MPU6050 I2C address
/* FSR testing sketch.
Connect one end of FSR to power, the other end to Analog 0.
Then connect one end of a 10K resistor from Analog 0 to ground
For more information see www.ladyada.net/learn/sensors/fsr.html */
int fsrPin = 1; // the FSR and 10K pulldown are connected to a0
int fsrReading; // the analog reading from the FSR resistor divider
int fsrVoltage; // the analog reading converted to voltage
//Program to test the angle sensor. Please check the circuit diagram for wiring.
int angle_pin = 0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
// declare the ledPin as an OUTPUT:
Serial.begin(9600);
}
@vikkey321
vikkey321 / index.html
Created September 30, 2019 03:47
Code to show temperature and humidity on webpage
<!DOCTYPE html>
<!--
/****************************************************/
/************** Created by : Vivek Gupta ************/
/*************** www.vsgupta.in *************/
/****************************************************/
-->
<html lang="en">
<head>
@vikkey321
vikkey321 / Arduino_code.ino
Created September 30, 2019 03:46
Arduino code to update temperature and humidity
#include <ESP8266WiFi.h>
#include "DHT.h"
#define DHTPIN D1
#define DHTTYPE DHT11
const char* ssid = "wifi username";
const char* password = "wifi password";
const char* host = "Your host url";
DHT dht(DHTPIN, DHTTYPE);
@vikkey321
vikkey321 / index.html
Created September 10, 2019 14:53
Creating-your-own-IoT-cloud-from-scratch-using-php--Mysql--ESP12E
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="Vikkey" content="Vivek Gupta & IoTMonk">
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<!-- If you are opening this page from local machine, uncomment belwo line
@vikkey321
vikkey321 / Arduino_code.ino
Created September 10, 2019 14:51
Creating-your-own-IoT-cloud-from-scratch-using-php--Mysql--ESP12E
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>
const char* ssid = "wifiusername";
const char* password = "wifpassword";
const char* host = "monker.000webhostapp.com"; //replace it with your webhost url
String url;
int count = 0;
void setup() {
Serial.begin(115200);
@vikkey321
vikkey321 / read_all.php
Created September 10, 2019 14:50
Creating-your-own-IoT-cloud-from-scratch-using-php--Mysql--ESP12E
<?php
/****************************************************/
/************** Created by : Vivek Gupta ************/
/*************** www.vsgupta.in *************/
/*************** www.iotmonk.com *************/
/****************************************************/
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
@vikkey321
vikkey321 / read_all.php
Created September 10, 2019 14:50
Creating-your-own-IoT-cloud-from-scratch-using-php--Mysql--ESP12E
<?php
/****************************************************/
/************** Created by : Vivek Gupta ************/
/*************** www.vsgupta.in *************/
/*************** www.iotmonk.com *************/
/****************************************************/
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
@vikkey321
vikkey321 / update.php
Created September 10, 2019 14:46
Creating your own IoT cloud from scratch using php, Mysql, ESP12E
<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
//Creating Array for JSON response
$response = array();
// Check if we got the field from the user
if (isset($_GET['id']) && isset($_GET['temp'])) {
$id = $_GET['id'];