ESP32 Arduino開発 #3 PWM制御|ブザーでドレミファソラシドを鳴らす - イーテック開発ブログ (e-tecinc.co.jp)
https://wak-tech.com/archives/923 も参考になる spiffsも応用されていた
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
"exec: "python": executable file not found in $PATH - Stack Overflow
sudo ln -s /usr/bin/python3 /usr/bin/python これでpython is python3となってエラがでなくなった
--------------------------------------------------------------
https://github.com/me-no-dev/ESPAsyncWebServer and
https://github.com/me-no-dev/AsyncTCP をライブラリ入れて
https://wak-tech.com/archives/1589#ESPAsyncWebServer を成功した
------------- soft access point on esp32 ---------
#include <WiFi.h>
const char ssid[] = "ESP32AP-WiFi";
const char pass[] = "esp32apwifi";
const IPAddress ip(192,168,30,3);
const IPAddress subnet(255,255,255,0);
const char html[] =
"<!DOCTYPE html><html lang='ja'><head><meta charset='UTF-8'>\
<style>input {margin:8px;width:80px;}\
div {font-size:16pt;color:red;text-align:center;width:400px;border:groove 40px orange;}</style>\
<title>WiFi_Car Controller</title></head>\
<body><div><p>Tank Controller</p>\
<form method='get'>\
<input type='submit' name='on' value='on' />\
<input type='submit' name='off' value='off' />\
</form></div></body></html>";
WiFiServer server(80);
void setup()
{
Serial.begin(115200);
WiFi.softAP(ssid,pass);
delay(100);
WiFi.softAPConfig(ip,ip,subnet);
IPAddress myIP = WiFi.softAPIP();
pinMode(0, OUTPUT);
delay(10);
server.begin();
Serial.print("SSID: ");
Serial.println(ssid);
Serial.print("AP IP address: ");
Serial.println(myIP);
Serial.println("Server start!");
}
void loop(){
WiFiClient client = server.available();
if (client) {
String currentLine = "";
Serial.println("New Client.");
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.write(c);
if (c == '\n') {
if (currentLine.length() == 0) {
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println();
client.print(html);
client.println();
break;
} else {
currentLine = "";
}
} else if (c != '\r') {
currentLine += c;
}
if (currentLine.endsWith("GET /?on")) {
digitalWrite(0, HIGH);
}
if (currentLine.endsWith("GET /?off")) {
digitalWrite(0, LOW);
}
}
}
client.stop();
Serial.println("Client Disconnected.");
}
}
------------------------------------------------------------------------------
CP210x USB - UART ブリッジ VCP ドライバ - Silicon Labs (silabs.com)
cp210x vcp windowsよりインストする(windows10でusbが!のとき)
------------------------------------------------------------------------
arduinoとは教科書どうりだった
https://qiita.com/suruseas/items/14ae3c7514775f0b1fc4 手持ちのUSBシリアルで
ubuntuのgtktermと交信成功 dev/tty-usbを選択! Gnd共通化!
0 件のコメント:
コメントを投稿