This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="example.siva.com.hellokotlin.MainActivity"> | |
<Button | |
android:id="@+id/helloMe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example.siva.com.hellokotlin | |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.util.Log | |
import kotlinx.android.synthetic.main.activity_main.* | |
import org.jetbrains.anko.toast | |
import android.net.wifi.WifiConfiguration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="example.siva.com.hellokotlin"> | |
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"> | |
</uses-permission> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"> | |
</uses-permission> | |
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"> | |
</uses-permission> | |
<application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "freertos/FreeRTOS.h" | |
#include "freertos/task.h" | |
#include "driver/gpio.h" | |
void blink_task(void *pvParameter) | |
{ | |
//GPIO_NUM_16 is G16 on board | |
gpio_set_direction(GPIO_NUM_16,GPIO_MODE_OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "freertos/FreeRTOS.h" | |
#include "freertos/task.h" | |
#include "freertos/queue.h" | |
QueueHandle_t q=NULL; | |
void consumer_task(void *pvParameter) | |
{ | |
unsigned long counter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.anhure.test3.test3android; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
import android.widget.ImageView; | |
import android.widget.TextView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int id=99; | |
#include <SoftwareSerial.h> | |
SoftwareSerial sw(2, 3); // RX, TX | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("Interfacfing arduino with nodemcu"); | |
sw.begin(115200); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
#include <PubSubClient.h> | |
// Update these with values suitable for your network. | |
const char* ssid = "SSID"; | |
const char* password = "pwd"; | |
const char* mqtt_server = "iot.eclipse.org"; | |
#define mqtt_port 1883 | |
#define MQTT_USER "username" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
#include <PubSubClient.h> | |
#include <ArduinoJson.h> | |
// Update these with values suitable for your network. | |
const char* ssid = "SSID"; | |
const char* password = "PASSWORD"; | |
const char* mqtt_server = "iot.eclipse.org"; | |
#define mqtt_port 1883 | |
#define MQTT_USER "username" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
#include <PubSubClient.h> | |
// Update these with values suitable for your network. | |
const char* ssid = "SSID"; | |
const char* password = "password"; | |
const char* mqtt_server = "broker.mqtt-dashboard.com"; | |
#define mqtt_port 1883 | |
#define MQTT_USER "mqtt username" |