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
test |
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); | |
} | |
void loop() { | |
delay(500); | |
Serial.println("HElloWorld"); | |
} |
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
String[] ports = SerialPort.GetPortNames();;//เก็บพอร์ตที่เชื่อมต่อนะครับ | |
SerialPort port = new SerialPort("COM4", 9600, Parity.None, 8, StopBits.One); | |
port.DataReceived += port_Data; | |
port.Open(); | |
port.ReadLine(); |
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
using System; | |
using System.IO.Ports; | |
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
//public static string[] ports; | |
public static SerialPort port; | |
static void Main(string[] args) | |
{ |
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
String name = ""; | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
getText(); | |
if (name != "") { | |
Serial.println("HEllo: " + name); | |
name = ""; | |
} |
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
using System; | |
using System.IO.Ports; | |
namespace ConsoleApplication2 | |
{ | |
class Program | |
{ | |
//public static string[] ports; | |
public static SerialPort port; | |
static void Main(string[] args) | |
{ |
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 BLYNK_PRINT Serial | |
#include <ESP8266WiFi.h> | |
#include <BlynkSimpleEsp8266.h> | |
char auth[] = "--Token--";//นำโทเค็นในแอพมาใส่ | |
char ssid[] = "--SSID--";//ชื้่อไวไฟ | |
char pass[] = "--PASSWORDWIFI--";//พาสเวิด | |
WidgetLCD lcd(V0);//เรียกใช้LCDโดยV0==VIRTURLPIN ที่เลือกไว้นะครับ | |
void setup() |
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
String setJsonString(int counts) { | |
String jsonS = "{\n"; | |
jsonS += "\"homeMobileCountryCode\": 234,\n"; // this is a real UK MCC | |
jsonS += "\"homeMobileNetworkCode\": 27,\n"; // and a real UK MNC | |
jsonS += "\"radioType\": \"gsm\",\n"; // for gsm | |
jsonS += "\"carrier\": \"Vodafone\",\n"; // associated with Vodafone | |
jsonS += "\"wifiAccessPoints\": [\n"; | |
for (int j = 0; j < counts; ++j) | |
{ | |
jsonS += "{\n"; |
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 callRestAPI(String jsonString, String host, String url, String key) { | |
WiFiClientSecure client; | |
DynamicJsonBuffer jsonBuffer; | |
Serial.print("Requesting URL: "); | |
Serial.println(" "); | |
if (client.connect(Host, 443)) { //443 | |
Serial.println("Connected"); | |
client.println("POST " + url + key + " HTTP/1.1"); | |
client.println("Host: " + (String)Host); | |
client.println("Connection: close"); |
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 <ArduinoJson.h> | |
const char* Host = "www.googleapis.com"; | |
String thisPage = "/geolocation/v1/geolocate?key="; | |
String key = "AIzaSyDeUxorNncriqxB3c2jVz0GrLfqpFG1A4c"; | |
double latitude = 0.0; | |
double longitude = 0.0; | |
double accuracy = 30.0; | |
int check = 0; |
OlderNewer