Ongoingmaster controller destiller board
STDmaster controller destiller board
License
:Public Domain
Description
DO NOT ALTER MY PROJECT SHARED FOR DEVELOPER
#include <HTTPClient.h>
// Function to fetch electricity price from the server
float fetchElectricityPrice() {
HTTPClient http;
http.begin("http://yourserver.com/get_price"); // Replace with your server URL
int httpCode = http.GET(); // Send the request
if (httpCode > 0) { // Check for a valid response
String response = http.getString();
return response.toFloat(); // Convert the response to a float
} else {
Serial.println("Failed to fetch electricity price");
return -1.0; // Error case
}
http.end(); // End the request
}
// Function to fetch pellet price if needed
float fetchPelletPrice() {
// If the pellet price is dynamic, you can implement a similar function for it
return 50.0; // Example static price for pellets (in Öre/kWh)
}
// Main function to handle price comparison and heating control
void priceControl() {
float currentElectricityPrice = fetchElectricityPrice(); // Get the current electricity price
float pelletPrice = fetchPelletPrice(); // Get the pellet price
if (currentElectricityPrice > 0) { // Ensure valid electricity price
controlHeating(currentElectricityPrice, pelletPrice); // Control heating based on prices
}
}
Design Drawing
The preview image was not generated, please save it again in the editor.BOM
Bom empty
CloneProject Members
Empty


Comment