Hallo.
Ich bin neu hier und mache meine Esten Schritte mit dem Arduino Uno .
Ich baue mir gerade ein Tiefzieherät und habe. Das Sketch habe ich bekommen. Beim Instatieren bekomme ich die Fehlermeldung
H:\Tiefzieher\VacuumFormer\VacuumFormer.ino:13:10: fatal error: max6675.h: No such file or directory
#include <max6675.h>
^~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: max6675.h: No such file or directory
Das ist der Sketch den ich bekommen habe.
Kann mir da jemand helfen?
//===================================================================================================================
//= M A K E & T I N K E R =
//= Vacuum Former v1.0 =
//= March 2020 =
//= =
//= http://www.youtube.com/makeandtinker/ =
//===================================================================================================================
//*******************************************************************************************************************
// INITIALIZATION
//*******************************************************************************************************************
#include <max6675.h>
#include <Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // Parameters: (rs, enable, d4, d5, d6, d7)
const int maxTemp = 290; // Stores the maximum temperature that the coils are allowed to reach (in Celsius)
const int maxWarn = 49; // Stores the temperature that triggers a warning for dangerous hot surface (in Celsius)
// Custom thermometer icon for the LCD display:
byte thermo[8] = {
B00100,
B01010,
B01010,
B01110,
B01110,
B11111,
B11111,
B01110
};
// Custom heating element icon for the LCD display:
byte coil[8] = {
B11111,
B00000,
B01001,
B10010,
B10010,
B01001,
B01001,
B10010
};
//Asign pin numbers for connections to sensors and parts
const byte pinRelay = 2; //Pin for relay data
const byte ledPinR = 10; // Red value for RGB LED
const byte ledPinG = 12; // Green value for RGB LED
const byte ledPinB = 13; // Blue value for RGB LED
const byte pinBuzzer = A3; // Pin data for piezo buzzer
const byte pinSwitch = A4; // Pin data for safety switch
const long runTime = 1000; //Read time every 1 second
unsigned long prev_runTime = 0; // Previous run time
bool heatStarted = false; // Holds the value for the heating coil power status
bool switchStatus = false; // Holds the value for the safety switch
int heatTimer = 0; // Set milliseconds for alarm timer to 0
const int maxRunTime = 40; // Minutes to max running time before shutdown
const int maxTime = 1500; // Set seconds to run before alarm sounds (1500 = 25 mins)
int mins = 0; // Minutes elapsed
int secs = 0; // Seconds elapsed
String tempNow = ""; // Holds value of current temperature
//Thermocouple setup:
#define CONFIG_TCSCK_PIN A0
#define CONFIG_TCCS_PIN A1
#define CONFIG_TCDO_PIN A2
MAX6675 thermocouple(CONFIG_TCSCK_PIN, CONFIG_TCCS_PIN, CONFIG_TCDO_PIN);
//*******************************************************************************************************************
// SETUP
//*******************************************************************************************************************
void setup() {
lcd.begin(20, 4); // Display is 20 characters long x 4 lines
lcd.createChar(0, thermo); //Creates custom char for thermometer
lcd.createChar(1, coil); //Creates custom char for heating coil
String tempNow; //Creates a string variable to hold the text value of the current temperature
// Setup pins on Arduino board:
pinMode(pinRelay, OUTPUT);
pinMode(pinSwitch, INPUT);
pinMode(pinBuzzer, OUTPUT);
pinMode(ledPinR, OUTPUT); // Red LED pin
pinMode(ledPinG, OUTPUT); // Green LED pin
pinMode(ledPinB, OUTPUT); // Blue LED pin
digitalWrite(pinRelay, HIGH); //To be safe, start with the relay turned off (power cut to coils)
//Turn on the LED in blue:
analogWrite(ledPinR, 0);
analogWrite(ledPinG, 0);
analogWrite(ledPinB, 255);
//Display splash screen information on LCD:
lcd.setCursor(2, 0);
lcd.print("MAKE & TINKER");
lcd.setCursor(3, 2);
lcd.print("Vacuum Former");
lcd.setCursor(7, 3);
lcd.print("v 1.0");
// Play the startup tune:
tone(pinBuzzer, 1000, 250);
delay(250);
tone(pinBuzzer,500, 250);
delay(250);
tone(pinBuzzer, 2000, 500);
delay(2000);
lcd.clear(); // Clear the LCD screen:
}
//*******************************************************************************************************************
// EMERGENCY SHUTDOWN LOOP
//*******************************************************************************************************************
void doShutDown() {
// This is an ENDLESS LOOP for emergency shutdown
// The machine has to be turned off and on again to restart
digitalWrite(pinRelay, HIGH); //First, turn off relay to cut power to heating coils
lcd.clear(); // Display info about emergency shutdown on LCD:
lcd.setCursor(0,0);
lcd.print("");
lcd.setCursor(1,1);
lcd.print(" SAFETY SHUTDOWN ");
lcd.setCursor(0,2);
lcd.print("<-- RESTART REQUIRED");
lcd.setCursor(0,3);
lcd.print("");
while (1>0) { // Blink the LED and sound alarm:
analogWrite(ledPinR, 255); // Turn on the LED red
analogWrite(ledPinG, 0);
analogWrite(ledPinB, 0);
tone(pinBuzzer, 300, 500); // Sound the alarm
delay(600);
analogWrite(ledPinR, 0); //Turn off the LED
analogWrite(ledPinG, 0);
analogWrite(ledPinB, 0);
tone(pinBuzzer, 300, 500); // Sound the alarm
delay(600);
}
}
//*******************************************************************************************************************
// MAIN LOOP
//*******************************************************************************************************************
void loop() {
unsigned long currTime = millis(); // Time elapsed in milliseconds
lcd.setCursor(0, 1);
lcd.write(byte(0)); //Draws the thermometer icon
lcd.setCursor(2, 1);
// DISPLAY INFO ON THE SCREEN AND STATUS LED /////////////////////////////////////////////////////////////////////
lcd.print(String(int(thermocouple.readCelsius())) + ((char)223) + "C " + String(int(thermocouple.readFarenheit())) + ((char)223) + "F "); // Show the temperature in ºC and ºF
tempNow = (String(int(thermocouple.readCelsius()))); // Store the current temp reading from thermocouple
if (tempNow.toInt() > maxWarn) { //If temperature is higher than the max safe value:
lcd.setCursor(0, 0); // Sets the curson on the first row
lcd.print ("** CAUTION! HOT! "); //Display the warning message on the screen
lcd.setCursor(0, 3); // Sets the curson on the 4th row
lcd.print (" CAUTION! HOT! **"); //Display the warning message on the screen
analogWrite(ledPinR, 255); //Turn on the LED in Red
analogWrite(ledPinG, 0);
analogWrite(ledPinB, 0);
}
else {
lcd.setCursor(0, 0); // Sets the cursor on the first row
lcd.print (" "); //Erase the warning message on the screen
lcd.setCursor(0, 3); // Sets the cursor on the first row
lcd.print (" "); //Erase the warning message on the screen
analogWrite(ledPinR, 0); //Turn on the LED in Green
analogWrite(ledPinG, 255);
analogWrite(ledPinB, 0);
}
// SAFETY TIMER AND ALARM /////////////////////////////////////////////////////////////////////////////////////////
switchStatus = String(digitalRead(pinSwitch)) == "1";
if (!heatStarted) { //If timer has not started, check if the button is pressed:
if (switchStatus) { //If the button is pressed, start the timer
heatStarted = true;
}
else { //If the safety switch is not pressed, reset the timer:
heatTimer = 0;
}
}
else {
if (switchStatus) { //If the safety switch is pressed, add a second and check the time:
if (currTime - prev_runTime >= runTime){
heatTimer++; // Increase the timer
secs++; // Add 1 second to the seconds counter
if (secs == 60) { // If seconds are at 60:
mins++; // Add 1 minute
secs = 0; // Reset seconds to 0
}
// Convert time values to text:
String tmins = String(mins);
String tsecs = String(secs);
if (mins < 10) { // If minutes are less than 10, add a zero to the left
tmins = "0" + tmins;
}
if (secs < 10) { // If seconds are less than 10, add a zero to the left
tsecs = "0" + tsecs;
}
lcd.setCursor(8,1);
lcd.print(tmins + ":" + tsecs); //Display the elapsed operation time
if (heatTimer >= maxTime) { // If max time has been reached or exceeded, sound the alarm:
tone(pinBuzzer, 300, 500);
}
prev_runTime = currTime; // Set the current time as previous time
if (mins >= maxRunTime) { // If the heating coils have been working for more time than the max run time:
doShutDown(); // Go to the emergency shutdown function
}
}
}
else { //If timer is running but the safety switch is not pressed, turn off the alarm and reset the flag the timer:
noTone(pinBuzzer);
heatStarted = false;
heatTimer = 0; // Reset timer to 0
mins=0; // Reset minutes to 0
secs=0; // Reset seconds to 0
lcd.setCursor(8,1);
lcd.print(" "); // Erase the time on LCD
}
}
// CONTROL THE HEATING COILS WITH THE RELAY DEPENDING ON SENSOR AND/OR SWITCH INPUT ////////////////////////////////
if (switchStatus) { //If the safety switch is pressed (frame is up and ready to work):
//Check if the temperature of the heating elements is under the safe limit:
if (tempNow.toInt() > maxTemp) { //If coil temperature exceeds the value set for maxTemp, disconect the relay to turn it off
digitalWrite(pinRelay, HIGH);
lcd.setCursor(0,2);
lcd.write(byte(1)); //Draws the heating element icon
lcd.setCursor(2,2);
lcd.print ("OFF "); //Display the heating coil's status on the screen
}
else {
//If coil temperature is under the set value for maxTemp, engage the relay to turn it on
digitalWrite(pinRelay, LOW);
lcd.setCursor(0,2);
lcd.write(byte(1)); //Draws the heating element icon
lcd.setCursor(2,2);
lcd.print ("ON FOR:"); //Display the heating coil's status on the screen
}
}
else { //If the safety switch is not pressed (frame is down, not ready to work):
digitalWrite(pinRelay, HIGH); //Turn off the heating element, regardless of actual temperature
lcd.setCursor(0,2);
lcd.write(byte(1)); //Draws the heating element icon
lcd.setCursor(2,2);
lcd.print ("OFF "); //Display the heating coil's status on the screen
}
delay(500); // Milliseconds to wait before restarting loop
}