Code: Select all
#include <SimpleFOC.h>
#include <ESPAsyncWebServer.h>
void setup(){
// Route for root / web page
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, "text/html", index_html, processor);
});
server.on("/pressure", HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, "text/plain", atmoshpere().c_str());
}); }
xTaskCreatePinnedToCore(
Task1code, //function name
"Task1", // name
10000, // stack size
NULL, // type
2, // priority
&Task1, // task handle
0 // core number
);
void loop(){
motor.move(target_velocity);
motor_i = motor_i +1;
if (motor_i>= 3000){
if (target_velocity<50){
target_velocity = target_velocity + .25;
}
motor_i = 0;
}
}