Jump to content
ELFORUM - Forumul electronistilor

Statie de aer cald cu arduino.


gpmarian2005

Recommended Posts

Buna ziua, doresc sa fac o statie de aer cald pentru lipit/dezlipit SMPD-uri. Am gasit un proiect bazat pe MAX 6675 insa intampin urmatoarea problema: cand vreau sa incarc programul in arduino, imi da o eroare, pe care nu am cunostinte sa o remediez.

Ma poate ajuta cineva, care are cunostinte de programare?

Proiectul este AICI

Programul:

#include <max6675.h>

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#include <MAX6675.h>





// Initialize the MAX6675 Library for our chip

LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display
int chauffe; 
int vent;
int plus;
int moins;
int led;
int temperature;
int etatboutonplus;
int etatboutonmoins;
int reed;
int CS = 5;             // CS pin on MAX6675
int SO = 4;              // SO pin of MAX6675
int aSCK = 6;             // SCK pin of MAX6675
int units = 1;            // Units to readout temp (0 = raw, 1 = ˚C, 2 = ˚F)
float temperaturemesure = 0.0;  // Temperature output variable

//MAX6675 thermocouple(thermoCLK, thermoCS, thermoSO); units
MAX6675 temp(CS, SO, aSCK);
void setup()
{
  temperature=200;
  chauffe= 13;
  vent=12;
  plus=11;
  moins=7;
  led=3;
  reed=2;
  pinMode(chauffe, OUTPUT); 
  pinMode(vent, OUTPUT); 
  pinMode(plus, INPUT_PULLUP); 
  pinMode(moins, INPUT_PULLUP); 
  pinMode(led, OUTPUT);
  pinMode(reed, INPUT_PULLUP);
  
  lcd.init();                      // initialize the lcd 
  lcd.backlight();
  lcd.setCursor(3,0);
  lcd.print("Station a ");
  lcd.setCursor(3,1);
  lcd.print("air chaud ");
  delay(1500);
  lcd.clear();
  lcd.setCursor(1,0);
  lcd.print("Marmotte 2017");
  lcd.setCursor(3,1);
  lcd.print("Version 1 ");
  delay(1500);
    
}


void loop()
{
  temperaturemesure = temp.read_temp();
   lcd.clear();
   lcd.setCursor(0,0);
   lcd.print("Reglage: ");
  lcd.print(temperature);
  lcd.print(" C");
   lcd.setCursor(0,1);
   lcd.print(temperaturemesure);
  if (digitalRead (5) == LOW)
 {
   digitalWrite(led, LOW);
    lcd.setCursor(0,1);
   lcd.print("Station en pause");
    
  }
else {
 
  
  if (temperaturemesure <= temperature)
  {
  
  digitalWrite(chauffe, HIGH);
  digitalWrite(led, HIGH);
  digitalWrite(vent, HIGH);
  }
  else {
    digitalWrite(chauffe, LOW);
    digitalWrite(led, LOW);
    digitalWrite(vent, HIGH);
  }
  }
 

  
  if (digitalRead (11) == LOW)
  {
   
    temperature=temperature+10;
    
  }
else {
 
  }

  if (digitalRead (7) == LOW)
 {
   
    temperature=temperature-10;
    
  }
else {

 }
  delay(100);

  
}

 

Eroarea:

In file included from D:\Hot air station\pistolet_a_air_chaud\pistolet_a_air_chaud.ino:5:0:

C:\Users\CNC\Documents\Arduino\libraries\MAX6675-library-master/MAX6675.h:10:7: error: redefinition of 'class MAX6675'

 class MAX6675 {

       ^

In file included from D:\Hot air station\pistolet_a_air_chaud\pistolet_a_air_chaud.ino:1:0:

C:\Users\CNC\Documents\Arduino\libraries\MAX6675-library-master/max6675.h:10:7: error: previous definition of 'class MAX6675'

 class MAX6675 {

       ^

pistolet_a_air_chaud:30: error: conflicting declaration 'MAX6675 temperaturemesure'

 MAX6675 temperaturemesure(CS,SO,aSCK,units);

                           ^

D:\Hot air station\pistolet_a_air_chaud\pistolet_a_air_chaud.ino:27:7: note: previous declaration as 'float temperaturemesure'

 float temperaturemesure = 0.0;  // Temperature output variable

       ^

D:\Hot air station\pistolet_a_air_chaud\pistolet_a_air_chaud.ino: In function 'void loop()':

pistolet_a_air_chaud:66: error: 'temp' was not declared in this scope

   temperaturemesure = temp.read_temp();

                       ^

Using library MAX6675-library-master at version 1.0.0 in folder: C:\Users\CNC\Documents\Arduino\libraries\MAX6675-library-master 
Using library Wire at version 1.0 in folder: C:\Users\CNC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\Wire 
Using library LiquidCrystal_I2C at version 1.1.2 in folder: C:\Users\CNC\Documents\Arduino\libraries\LiquidCrystal_I2C 
exit status 1
conflicting declaration 'MAX6675 temperaturemesure'

 

Eroare.png

Edited by gpmarian2005
Link to comment
  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Posibil sa fie acele conflicte pentru ca ai incluse doua librarii pentru MAX6675.

#include <max6675.h>

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#include <MAX6675.h>

 

Ar trebui comentata una din ele.

Eu as incerca folosirea librariei scrisa cu majuscule - MAX6675, dupa cum se vede din cod:

 

// Initialize the MAX6675 Library for our chip

LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display
int chauffe; 
int vent;
int plus;
int moins;
int led;
int temperature;
int etatboutonplus;
int etatboutonmoins;
int reed;
int CS = 5;             // CS pin on MAX6675
int SO = 4;              // SO pin of MAX6675
int aSCK = 6;             // SCK pin of MAX6675
int units = 1;            // Units to readout temp (0 = raw, 1 = ˚C, 2 = ˚F)
float temperaturemesure = 0.0;  // Temperature output variable

//MAX6675 thermocouple(thermoCLK, thermoCS, thermoSO); units
MAX6675 temp(CS, SO, aSCK);

 

Link to comment
  • 1 month later...

Am descarcat si instlat toate librariile gasite pe net pentru MAX6675, si tot nu mege.

Am instalat si testat diverse versiuni ale aceleiasi librari. si tot nu merge

Am lasat in cod doar o singura linie #include <MAX6675.h>. si tot nu merge.

Am instalat diverse versiuni de Arduino IDE, tot nu merge.

Oare care poate fi problema?

Link to comment

Sterge toate bibliotecile pentru MAX6675 "instalate" si in C:\Users\%USERNAME%\Documents\Arduino\libraries lasa doar arhiva atasata de mine.

La mine se compileaza cu IDE 1.8.5 si biblioteca atasata.

 

Libraria este acesta: https://github.com/mcleng/MAX6675-Library

 

Totusi de ce ai ales respectivul proiect pentru o suflanta cu aer cald? Personal imi pare o risipa de materiale / bani pentru un proiect fara algoritm de reglare a temperaturii.

MAX6675-Library.zip

 

l.e: Exista pe forum cel putin un subiect cu schema + soft mult superioare.

Edited by Stefan.
Link to comment

Moltumesc mult, cu arduino ide 1.8.5 si libraria indicata de tine a mers fara probleme.

Am ales acest proiect deoarece mi s-a parut mai simplu, iar eu nu am nevoie de o precizie foarte mare deoarece o folosesc mai mult la dezlipit.

Aici pe forum am dat cautare dupa urmatoarele cuvinte: hot air gun, statie aer cald, suflanta aer cald, statie lipire smd, si nu am gasit nimic.

 

Link to comment

Erau mai multe subiecte dar cautatea forumului e cam ciudata.

Nu e cu atmega328/168 (Arduino) ci cu atmega8 dar pentru mine conteaza mai mult cum functionalitatea nu cu ce e facuta. Am statia de lipit dupa schema rusilor si functioneaza excelent de cativa ani.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines