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" |
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
const mongoose = require('mongoose') | |
const util = require('util') | |
const stream = require('stream') | |
const pipeline = util.promisify(stream.pipeline) | |
const stringify = require('csv-stringify') | |
const fs = require('fs') | |
const fsp = require('fs').promises | |
let schema = mongoose.Schema({ |
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
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 three parameters, the endpoint, formdata (except fiels),files (key,File) | |
* returns Response from server |
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:path/path.dart'; | |
import 'dart:io'; | |
import 'dart:async'; | |
import 'package:dio/dio.dart'; | |
/** | |
* accepts three parameters, the endpoint, formdata (except fiels),files (key,File) | |
* returns Response from server | |
*/ | |
Future<Response> sendForm( |
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:path/path.dart'; | |
import 'dart:io'; | |
import 'dart:async'; | |
import 'package:dio/dio.dart'; | |
/** | |
* accepts two parameters,the endpoint and the file | |
* returns Response from server | |
*/ | |
Future<Response> sendFile(String url, File file) async { |
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
#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
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); |