Bonjour a tous ,
s'il vous plait qui peut m'aider je suis débutant sur arduino et je travaille sur un projet en utilisant ethernet shield et wamp server :
envoyer les valeurs de capteur de température vers base de donnée !
mais j'ai rencontré un problème dans la moniteur série s'affiche tous les valeur mais dans la base aucun valeur ajouter
ps: lorsque j'ajout une valeur avec lien localhost est bien marché !
code arduino
#include <SPI.h>
#include <Ethernet.h>
#include "lm35.h"
#define LM35PIN 0
#define lm35
#define LM35TYPE lm35
byte mac[] = { "0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED" };
byte ip[] = {"169, 254, 30, 136" }; //Enter the IP of ethernet shield
byte serv[] = {"192, 168, 137, 107"} ; //Enter the IPv4 address
EthernetClient cliente;
float temp;
int tempPIN= 0;
void setup() {
Serial.begin(9600); //setting the baud rate at 9600
Ethernet.begin(mac, ip);
}
void loop() {
temp=analogRead(tempPIN);
if (cliente.connect(serv, 80)) { //Connecting at the IP address and port we saved before
Serial.println("connected");
cliente.print("GET /ethernet/connection.php?"); //Connecting and Sending values to database
cliente.print("temperature=");
cliente.print(temp);
//Printing the values on the serial monitor
Serial.print("Temperature= ");
Serial.println(temp);
cliente.stop(); //Closing the connection
}
else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
delay(5000);
}