OSHWLab
check in
Ongoing

master controller destiller board

STDmaster controller destiller board

tag

80
0
0
0
Mode:Full

License

Public Domain

Creation time:2024-01-27 16:43:36Update time:2024-09-28 18:54:31

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

Attachments

OrderFile nameDownload times
No data
Clone
Add to Album
0
0
Share
Report

Project Members

Comment

All Comments(1)
Sort by time|Sort by popularity
Followers0|Likes0
Related projects
Empty

Bottom Navigation