Skip to content

Instantly share code, notes, and snippets.

View Blink.ino
View AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
View ToLight.ino
// Libraries
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <WiFiHelper.h>
// Credentials
String deviceId = "Your Device ID"; // * set your device id (will be the MQTT client username)
String deviceSecret = "Your Device Secret"; // * set your device secret (will be the MQTT client password)
String clientId = "Light"; // * set a random string (max 23 chars, will be the MQTT client id)
View connectINTERNET.xml
<uses-permission android:name="android.permission.INTERNET" />
View MainActivity.java
package com.example.toshiba.test01;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
View activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context=".MainActivity"
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.toshiba.test01" >
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
You can’t perform that action at this time.