in the future - u will be able to do some more stuff here,,,!! like pat catgirl- i mean um yeah... for now u can only see others's posts :c
#include "FS.h"
#include "SPIFFS.h"
#include "ML_DTree.h"
#include <WiFi.h>
#include <Wire.h>
#include <HTTPClient.h>
#include <UrlEncode.h>
Eloquent::ML::Port::RandomForestRegressor clf;
#define AP_SSID "a54" //更換成自己手機的基地台名稱與密碼
#define AP_PWD "49125831"
//這邊要改成在IFTTT你設定的連結,才會連結到你的帳號發布訊息
#define IFTTT_URL "maker.ifttt.com/trigger/LINEtest/with/key/HmD2788x…"
void notify(float predict, float accuracy) {
String ifttt_url = IFTTT_URL;
String url = ifttt_url + "?value1=4B015054&value2=" + String(predict);
HTTPClient http;
http.begin(url);
int httpCode = http.GET();
if (httpCode < 0) Serial.println("連線失敗");
else Serial.println("連線成功");
http.end();
}
void setup() {
Serial.begin(115200);
WiFi.begin(AP_SSID, AP_PWD);
while(WiFi.status() != WL_CONNECTED){
Serial.print(".");
delay(5000);
}
if (!SPIFFS.begin(true)) {
Serial.println("An error has occurred while mounting SPIFFS");
return;
}
File file = SPIFFS.open("/test.csv", FILE_READ);
if (!file) {
Serial.println("Failed to open file for reading");
return;
}
// // 跳过第一行(标题行)
// if (file.available()) {
// file.readStringUntil('\n');
// }
// 读取剩余的行并进行预测
while (file.available()) {
String line = file.readStringUntil('\n');
predictScore(line);
}
Serial.println("\n成功連上基地台!");
file.close();
}
void predictScore(String line) {
int firstCommaIndex = line.indexOf(',');
int secondCommaIndex = line.indexOf(',', firstCommaIndex + 1);
int thirdCommaIndex = line.indexOf(',', secondCommaIndex + 1);
// 假设测试数据有 3 特征
float testSample[3];
testSample[0] = line.substring(0, firstCommaIndex).toFloat();
testSample[1] = line.substring(firstCommaIndex + 1, secondCommaIndex).toFloat();
testSample[2] = line.substring(secondCommaIndex + 1, thirdCommaIndex).toFloat();
Serial.print("Predicted label for [");
Serial.print(testSample[0]);
Serial.print(", ");
Serial.print(testSample[1]);
Serial.print(", ");
Serial.print(testSample[2]);
Serial.print("] : ");
Serial.println(clf.predict(testSample));
float prediction = clf.predict(testSample);
Serial.println(prediction);
notify(prediction, 0.0);
}
void loop() {
// 这里不需要重复执行的代码
delay(10000);
}
0 - 0
異界塔39打法
上排狂亂一家,下排50超特急、50+1大力鉗、40機器貓(體力本能5+打飛無效)、40姆特、50飛腳貓,閃電砲18級,土豪貓
一開始等錢,河豚快到的時候一直出狂牆,河豚攻擊完立刻出姆特,狂牆不要停,可以很穩定收掉河豚
河豚死後就靠機器貓坦,下排和狂牆有就派,這關有帶土豪和穩定打死黑海馬的話不缺錢
要出姆特的時候要留意不要剛好被紅帽打死(對就是我),姆特快到時再放閃電砲,多少能打個一下
帶狙擊反而會害機器貓打空
0 - 0