Bonjour,
Je cherche à récupérer la lecture d’un module MAX6675 sur jeedom.
J’ai donc branché l’ensemble et modifié les scketch de Jeedouino avec un Usersketch.
Voici les sections modifiées :
// UserVars
// Vos declarations de variables / includes etc....
//#include <your_stuff_here.h>
#include « max6675.h »
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
//// User Setup
#if (UserSketch == 1)
void UserSetup()
{
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
}
#endif
// Votre loop()
// pour envoyer une valeur a jeedom, il suffit de remplir la variable jeedom comme cela :
jeedom += '&';
jeedom += 500; // avec u = numero de la pin "info" dans l'equipement jeedom - info pin number
jeedom += '=';
jeedom += thermocouple.readCelsius();
J’ai créé un seul pin utilisateur : le 500 configuré dans jeedom entant que 'entrée numérique sous type autre"
Les pins materielles 2 à 6 sont ‹ non utilisées › dans jeedom
Le script original à téléverser sur l’ardouino pour avoir une lecture de la temperature dans le moniteur est le suivant :
#include « max6675.h »
int thermoDO = 4;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 3;
int gndPin = 2;
void setup() {
Serial.begin(9600);
// use Arduino pins
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
Serial.println(« MAX6675 test »);
// wait for MAX chip to stabilize
delay(500);
}
void loop() {
// basic readout test, just print the current temp
Serial.print("C = ");
Serial.println(thermocouple.readCelsius());
Serial.print("F = ");
Serial.println(thermocouple.readFahrenheit());
delay(1000);
}
Auriez vous une idée de ce qui cloche ?
Merci d’avance

