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
void remove_all_bonded_devices(void) | |
{ | |
int dev_num = esp_ble_get_bond_device_num(); | |
esp_ble_bond_dev_t *dev_list = (esp_ble_bond_dev_t *)malloc(sizeof(esp_ble_bond_dev_t) * dev_num); | |
esp_ble_get_bond_device_list(&dev_num, dev_list); | |
for (int i = 0; i < dev_num; i++) { | |
esp_ble_remove_bond_device(dev_list[i].bd_addr); | |
} | |
free(dev_list); |
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
void setup() { | |
Serial.begin(9600); | |
pinMode(LED_BUILTIN, OUTPUT); | |
} | |
void loop() { | |
int cmd = Serial.parseInt(); | |
if(cmd == 1){ | |
digitalWrite(LED_BUILTIN, HIGH); | |
}else if (cmd == -1){ | |
digitalWrite(LED_BUILTIN, LOW); |
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
#define KEYBOARD_ENABLE_CONTROL PB2 | |
#define LDR_PIN PA4 | |
#define LDR_OBSTACLE_THRESHOLD 980 | |
#include "Keyboard.h" | |
void setup() { | |
Serial.begin(115200); | |
pinMode(LDR_PIN,INPUT); | |
pinMode(KEYBOARD_ENABLE_CONTROL,INPUT); |
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
import 'package:flutter/material.dart'; | |
import 'package:path/path.dart'; | |
import 'package:image_picker/image_picker.dart'; | |
import 'dart:io'; | |
import 'dart:async'; | |
import 'package:dio/dio.dart'; | |
/** | |
* accepts two parameters,the endpoint and the file |
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
public class Pair<T,R> { | |
private T key; | |
private R value; | |
public Pair(T key, R value) { | |
this.key = key; | |
this.value = value; | |
} | |
public T getKey() { |
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 <ESP8266WiFi.h> | |
#include <PubSubClient.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 "mqtt 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 <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
// Update these with values suitable for your network. | |
const char* ssid = "SSID"; | |
const char* password = "passowrd"; | |
const char* mqtt_server = "iot.eclipse.org"; | |
#define mqtt_port 1883 | |
#define MQTT_USER "username" |