Elektronika.lt
 2024 m. kovo 29 d. Projektas | Reklama | Žinokite | Klausimai | Prisidėkite | Atsiliepimai | Kontaktai
Paieška portale
EN Facebook RSS

 Kas naujo  Katalogas  Parduotuvės  Forumas  Tinklaraščiai
 Pirmas puslapisSąrašas
 Forumas / + pokalbiai
 - Paieška forume
 - D.U.K. / Forumo taisyklės
 - Narių sąrašas
 - Registruotis
 - Prisijungti

Elektronika.lt portalo forumas

Jūs esate neprisijungęs lankytojas. Norint dalyvauti diskusijose, būtina užsiregistruoti ir prisijungti prie forumo. Prisijungę galėsite kurti naujas temas, atsakyti į kitų užduotus klausimus, balsuoti forumo apklausose.

Administracija pasilieka teisę pašalinti pasisakymus bei dalyvius, kurie nesilaiko forumo taisyklių. Pastebėjus nusižengimus, prašome pranešti.

Dabar yra 2024 03 29, 13:20. Visos datos yra GMT + 2 valandos.
 Forumas » Mikrovaldikliai » Arduino web termometras
Jūs negalite rašyti naujų pranešimų į šį forumą
Jūs negalite atsakinėti į pranešimus šiame forume
Jūs negalite redaguoti savo pranešimų šiame forume
Jūs negalite ištrinti savo pranešimų šiame forume
Jūs negalite dalyvauti apklausose šiame forume
 
  
Puslapis 11
Pradėti naują temą  Atsakyti į pranešimą Rodyti ankstesnį pranešimą :: Rodyti kitą pranešimą 
 Arduino web termometras
PranešimasParašytas: 2017 08 02, 16:33 Pranešti apie taisyklių pažeidimą Atsakyti su citata
korne1
Dažnas dalyvis
Dažnas dalyvis
Peržiūrėti vartotojo aprašymą Siųsti asmeninį pranešimą Siųsti el. laišką
Sveiki, reikia pagalbos, dėl ds18b20 sensorių nuskaitymo per 5 ir 6 arduino portus. Dabar veikia tik per 5 pina visi sensoriai kurių adresai surašyti. Kaip atskirti, kad 5 sensorius skaitytų per 5 pina, likusius 5 sensorius per 6 arduino pina.

Kodas:
#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define TEMPERATURE_PRECISION 9
#define ONE_WIRE_BUS_1 5
#define ONE_WIRE_BUS_2 6
/////////////////////////////////////////////
float T1 = 0;
float T2 = 0;
float T3 = 0;
float T4 = 0;
float T5 = 0;
float T6 = 0;
float T7 = 0;
float T8 = 0;
float T9 = 0;
float T10 = 0;
OneWire oneWire1(ONE_WIRE_BUS_1);
OneWire oneWire2(ONE_WIRE_BUS_2);
DallasTemperature R70(&oneWire1);
DallasTemperature R71(&oneWire2);
////////////////// R70 termo pakaba ///////////////////////
DeviceAddress Probe01 = { 0x28, 0x73, 0x89, 0x4A, 0x01, 0x00, 0x00, 0xB7 };
//DeviceAddress Probe01 = { 0x28, 0x43, 0x4C, 0x59, 0x05, 0x00, 0x00, 0x84 };
DeviceAddress Probe02 = { 0x28, 0xBD, 0x47, 0x59, 0x05, 0x00, 0x00, 0x95 };
DeviceAddress Probe03 = { 0x28, 0x5B, 0x43, 0x59, 0x05, 0x00, 0x00, 0x11 };
DeviceAddress Probe04 = { 0x28, 0x8D, 0x41, 0x59, 0x05, 0x00, 0x00, 0xE4 };
DeviceAddress Probe05 = { 0x28, 0x3E, 0x4A, 0x59, 0x05, 0x00, 0x00, 0xCA };
////////////////// R71 termo pakaba /////////////////////////
//DeviceAddress Probe06 = { 0x28, 0x7A, 0x41, 0x59, 0x05, 0x00, 0x00, 0x13 };
DeviceAddress Probe06 = { 0x28, 0xC7, 0x21, 0x3A, 0x01, 0x00, 0x00, 0xC9 };
DeviceAddress Probe07 = { 0x28, 0x38, 0x39, 0x59, 0x05, 0x00, 0x00, 0x5B };
DeviceAddress Probe08 = { 0x28, 0x86, 0x3E, 0x59, 0x05, 0x00, 0x00, 0x1E };
DeviceAddress Probe09 = { 0x28, 0xC2, 0x45, 0x59, 0x05, 0x00, 0x00, 0xAA };
DeviceAddress Probe10 = { 0x28, 0x9A, 0x3D, 0x59, 0x05, 0x00, 0x00, 0x76 };
//////////////////////////////////////////////
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
  0x90, 0xA2, 0xDA, 0x10, 0x3C, 0xF0
};
IPAddress ip(192, 168, 0, 10);

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);

void setup() {
  R70.isParasitePowerMode();
  R71.isParasitePowerMode();
  R70.begin();
  R71.begin();
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();

}

void loop() {
  R70.requestTemperatures();
  T1 = R70.getTempC(Probe01);
  T2 = R70.getTempC(Probe02);
  T3 = R70.getTempC(Probe03);
  T4 = R70.getTempC(Probe04);
  T5 = R70.getTempC(Probe05);
 
  R71.requestTemperatures();
  T6 = R70.getTempC(Probe06);
  T7 = R70.getTempC(Probe07);
  T8 = R70.getTempC(Probe08);
  T9 = R70.getTempC(Probe09);
  T10 = R70.getTempC(Probe10);

  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println("Refresh: 5");  // refresh the page automatically every 5 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          /////////////////////////
          client.println("<style>");
          client.println("body {background-color: #F0E68C}");
          client.println("</style>");
          client.write("<title>R70_R71 Termometras</title></head>");
          /////////////////////////
          client.write("<body><div style='text-align: center'><br><hr />");
          client.write("<h1 style='color: #0066FF; font-family:Times New Roman, Times, serif;'>R70 - R71 bok&#353to temperat&#363ros monitoringas</h1><hr /><br><br>");
          ////////////////////////
          client.write("<table border='2' width='600' cellpadding='10' cellspacing='0'");
          client.write("align='center' style='text-align: center; font-size: large; font-family: Arial, Helvetica, sans-serif;'>");
          client.write("<th>R70 bok&#353tas</th><th>R71 bok&#353tas");
          client.write("</th>");
          ////////////////////////
          client.write("<table border='2' width='600' cellpadding='10' cellspacing='0'");
          client.write("align='center' style='text-align: center; font-size: large; font-family: Arial, Helvetica, sans-serif;'>");
          client.write("<tbody>");
          //////////////////////////////// 1 Eilutė

          client.write("<td>70:5");
          client.write("<td>");
          if ( T5 > - 50)
          {
            client.println(T5, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("<td>71:5");
          client.write("<td>");
          if ( T10 > - 50)
          {
            client.println(T10, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("</tr>");
          /////////////////////////////// 2 Eilutė
          client.write("<td>70:4");
          client.write("<td>");
          if ( T4 > - 50)
          {
            client.println(T4, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("<td>71:4");
          client.write("<td>");
          if ( T9 > - 50)
          {
            client.println(T9, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("</tr>");
          /////////////////////////////// 3 Eilutė
          client.write("<td>70:3");
          client.write("<td>");
          if ( T3 > - 50)
          {
            client.println(T3, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("<td>71:3");
          client.write("<td>");
          if ( T8 > - 50)
          {
            client.println(T8, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("</tr>");
          /////////////////////////////// 4 Eilutė
          client.write("<td>70:2");
          client.write("<td>");
          if ( T2 > - 50)
          {
            client.println(T2, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("<td>71:2");
          client.write("<td>");
          if ( T7 > - 50)
          {
            client.println(T7, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("</tr>");
          /////////////////////////////// 5 Eilutė
          client.write("<td>70:1");
          client.write("<td>");
          if ( T1 > - 50)
          {
            client.println(T1, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("<td>71:1");
          client.write("<td>");
          if ( T6 > - 50)
          {
            client.println(T6, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("</tr>");
          /////////////////////////////// Apatinė eilutė
          client.write("<h5 style='text-align: center; bottom: 0; position: absolute; left:50%; margin-left:-100px;'/h5><br><hr />");
          client.write("&#169 2017-04-21 Kornelijus. &#9742 **********.");
          client.println("</html>");
          break;
        }

      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();

  }
}
 Arduino web termometras
PranešimasParašytas: 2017 08 02, 17:14 Pranešti apie taisyklių pažeidimą Atsakyti su citata
dmb-220
Patyręs dalyvis
Patyręs dalyvis
Peržiūrėti vartotojo aprašymą Siųsti asmeninį pranešimą Siųsti el. laišką Apsilankyti vartotojo tinklapyje
Kodas:
 R71.requestTemperatures();
  T6 = R70.getTempC(Probe06);
  T7 = R70.getTempC(Probe07);
  T8 = R70.getTempC(Probe08);
  T9 = R70.getTempC(Probe09);
  T10 = R70.getTempC(Probe10);


T6 = R70 ... ar neturi buti T6 = R71 ... ?

_________________
Skype: dmb-220
 Arduino web termometras
PranešimasParašytas: 2017 08 02, 20:14 Pranešti apie taisyklių pažeidimą Atsakyti su citata
korne1
Dažnas dalyvis
Dažnas dalyvis
Peržiūrėti vartotojo aprašymą Siųsti asmeninį pranešimą Siųsti el. laišką
Dėkui už komentarą. Net nepastebėjau, kad klaidą tokią padariau. Tikėkimės, kad tai padės.
 Arduino web termometras
PranešimasParašytas: 2017 08 02, 20:45 Pranešti apie taisyklių pažeidimą Atsakyti su citata
korne1
Dažnas dalyvis
Dažnas dalyvis
Peržiūrėti vartotojo aprašymą Siųsti asmeninį pranešimą Siųsti el. laišką
Veikia puikiai. Dėkui dmb-220. Kodą įkelsiu pataisyta, gal kam prireiks Wink
Čia kaip atrodo:
[/img]
http://i.talpix.lt/8V8UW.jpg
Čia kodas:
Kodas:

#include <SPI.h>
#include <Ethernet2.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define TEMPERATURE_PRECISION 9
#define ONE_WIRE_BUS_1 5
#define ONE_WIRE_BUS_2 6
/////////////////////////////////////////////
float T1 = 0;
float T2 = 0;
float T3 = 0;
float T4 = 0;
float T5 = 0;
float T6 = 0;
float T7 = 0;
float T8 = 0;
float T9 = 0;
float T10 = 0;
OneWire oneWire1(ONE_WIRE_BUS_1);
OneWire oneWire2(ONE_WIRE_BUS_2);
DallasTemperature R70(&oneWire1);
DallasTemperature R71(&oneWire2);
////////////////// R70 termo pakaba ///////////////////////
DeviceAddress Probe01 = { 0x28, 0x74 , 0x71, 0x3E, 0x03, 0x00, 0x00, 0x43 };
DeviceAddress Probe02 = { 0x28, 0xBD, 0x47, 0x59, 0x05, 0x00, 0x00, 0x95 };
DeviceAddress Probe03 = { 0x28, 0x5B, 0x43, 0x59, 0x05, 0x00, 0x00, 0x11 };
DeviceAddress Probe04 = { 0x28, 0x8D, 0x41, 0x59, 0x05, 0x00, 0x00, 0xE4 };
DeviceAddress Probe05 = { 0x28, 0x3E, 0x4A, 0x59, 0x05, 0x00, 0x00, 0xCA };
////////////////// R71 termo pakaba /////////////////////////
DeviceAddress Probe06 = { 0x28, 0xFF, 0xC5, 0x99, 0xA3, 0x16, 0x05, 0xA1 };
DeviceAddress Probe07 = { 0x28, 0x38, 0x39, 0x59, 0x05, 0x00, 0x00, 0x5B };
DeviceAddress Probe08 = { 0x28, 0x86, 0x3E, 0x59, 0x05, 0x00, 0x00, 0x1E };
DeviceAddress Probe09 = { 0x28, 0xC2, 0x45, 0x59, 0x05, 0x00, 0x00, 0xAA };
DeviceAddress Probe10 = { 0x28, 0x9A, 0x3D, 0x59, 0x05, 0x00, 0x00, 0x76 };
//////////////////////////////////////////////
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
  0x90, 0xA2, 0xDA, 0x10, 0x3C, 0xF0
};
IPAddress ip(192, 168, 1, 10);

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);

void setup() {
  R70.isParasitePowerMode();
  R71.isParasitePowerMode();
  R70.begin();
  R71.begin();
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();

}

void loop() {
  R70.requestTemperatures();
  T1 = R70.getTempC(Probe01);
  T2 = R70.getTempC(Probe02);
  T3 = R70.getTempC(Probe03);
  T4 = R70.getTempC(Probe04);
  T5 = R70.getTempC(Probe05);
 
  R71.requestTemperatures();
  T6 = R71.getTempC(Probe06);
  T7 = R71.getTempC(Probe07);
  T8 = R71.getTempC(Probe08);
  T9 = R71.getTempC(Probe09);
  T10 = R71.getTempC(Probe10);

  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println("Refresh: 5");  // refresh the page automatically every 5 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          /////////////////////////
          client.println("<style>");
          client.println("body {background-color: #F0E68C}");
          client.println("</style>");
          client.write("<title>R70_R71 Termometras</title></head>");
          /////////////////////////
          client.write("<body><div style='text-align: center'><br><hr />");
          client.write("<h1 style='color: #0066FF; font-family:Times New Roman, Times, serif;'>R70 - R71 bok&#353to temperat&#363ros monitoringas</h1><hr /><br><br>");
          ////////////////////////
          client.write("<table border='2' width='600' cellpadding='10' cellspacing='0'");
          client.write("align='center' style='text-align: center; font-size: large; font-family: Arial, Helvetica, sans-serif;'>");
          client.write("<th>R70 bok&#353tas</th><th>R71 bok&#353tas");
          client.write("</th>");
          ////////////////////////
          client.write("<table border='2' width='600' cellpadding='10' cellspacing='0'");
          client.write("align='center' style='text-align: center; font-size: large; font-family: Arial, Helvetica, sans-serif;'>");
          client.write("<tbody>");
          //////////////////////////////// 1 Eilutė

          client.write("<td>70:5");
          client.write("<td>");
          if ( T5 > - 50)
          {
            client.println(T5, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("<td>71:5");
          client.write("<td>");
          if ( T10 > - 50)
          {
            client.println(T10, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("</tr>");
          /////////////////////////////// 2 Eilutė
          client.write("<td>70:4");
          client.write("<td>");
          if ( T4 > - 50)
          {
            client.println(T4, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("<td>71:4");
          client.write("<td>");
          if ( T9 > - 50)
          {
            client.println(T9, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("</tr>");
          /////////////////////////////// 3 Eilutė
          client.write("<td>70:3");
          client.write("<td>");
          if ( T3 > - 50)
          {
            client.println(T3, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("<td>71:3");
          client.write("<td>");
          if ( T8 > - 50)
          {
            client.println(T8, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("</tr>");
          /////////////////////////////// 4 Eilutė
          client.write("<td>70:2");
          client.write("<td>");
          if ( T2 > - 50)
          {
            client.println(T2, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("<td>71:2");
          client.write("<td>");
          if ( T7 > - 50)
          {
            client.println(T7, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("</tr>");
          /////////////////////////////// 5 Eilutė
          client.write("<td>70:1");
          client.write("<td>");
          if ( T1 > - 50)
          {
            client.println(T1, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("<td>71:1");
          client.write("<td>");
          if ( T6 > - 50)
          {
            client.println(T6, 1);
          }
          else {
            client.write("---");
          }
          client.println("&#8451");
          client.write("</tr>");
          /////////////////////////////// Apatinė eilutė
          client.write("<h5 style='text-align: center; bottom: 0; position: absolute; left:50%; margin-left:-100px;'/h5><br><hr />");
          client.write("&#169 2017-08-02 Elektronika.lt. &#9742 **********.");
          client.println("</html>");
          break;
        }

      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();

  }
}
 Arduino web termometras
PranešimasParašytas: 2017 08 02, 21:12 Pranešti apie taisyklių pažeidimą Atsakyti su citata
krienas
Patyręs dalyvis
Patyręs dalyvis
Peržiūrėti vartotojo aprašymą Siųsti asmeninį pranešimą
O kaip šiuos skaičius gavai?
Kodas:

{ 0x28, 0x73, 0x89, 0x4A, 0x01, 0x00, 0x00, 0xB7 };
 Arduino web termometras
PranešimasParašytas: 2017 08 03, 10:42 Pranešti apie taisyklių pažeidimą Atsakyti su citata
AlgisL
Senbuvis
Senbuvis
Peržiūrėti vartotojo aprašymą Siųsti asmeninį pranešimą
keliasdesimt eiluciu kodo ir ismeta i lcd ar per serial prijungto onewire daviklio adresa.
 Arduino web termometras
PranešimasParašytas: 2017 08 04, 19:31 Pranešti apie taisyklių pažeidimą Atsakyti su citata
korne1
Dažnas dalyvis
Dažnas dalyvis
Peržiūrėti vartotojo aprašymą Siųsti asmeninį pranešimą Siųsti el. laišką
krienas rašo:
O kaip šiuos skaičius gavai?
Kodas:

{ 0x28, 0x73, 0x89, 0x4A, 0x01, 0x00, 0x00, 0xB7 };

Aš naudoju šį kodą:
Kodas:

// Include the libraries we need
#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

// arrays to hold device address
DeviceAddress insideThermometer;

/*
 * Setup function. Here we do the basics
 */
void setup(void)
{
  // start serial port
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library Demo");

  // locate devices on the bus
  Serial.print("Locating devices...");
  sensors.begin();
  Serial.print("Found ");
  Serial.print(sensors.getDeviceCount(), DEC);
  Serial.println(" devices.");

  // report parasite power requirements
  Serial.print("Parasite power is: ");
  if (sensors.isParasitePowerMode()) Serial.println("ON");
  else Serial.println("OFF");
 
  // Assign address manually. The addresses below will beed to be changed
  // to valid device addresses on your bus. Device address can be retrieved
  // by using either oneWire.search(deviceAddress) or individually via
  // sensors.getAddress(deviceAddress, index)
  // Note that you will need to use your specific address here
  //insideThermometer = { 0x28, 0x1D, 0x39, 0x31, 0x2, 0x0, 0x0, 0xF0 };

  // Method 1:
  // Search for devices on the bus and assign based on an index. Ideally,
  // you would do this to initially discover addresses on the bus and then
  // use those addresses and manually assign them (see above) once you know
  // the devices on your bus (and assuming they don't change).
  if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find address for Device 0");
 
  // method 2: search()
  // search() looks for the next device. Returns 1 if a new address has been
  // returned. A zero might mean that the bus is shorted, there are no devices,
  // or you have already retrieved all of them. It might be a good idea to
  // check the CRC to make sure you didn't get garbage. The order is
  // deterministic. You will always get the same devices in the same order
  //
  // Must be called before search()
  //oneWire.reset_search();
  // assigns the first address found to insideThermometer
  //if (!oneWire.search(insideThermometer)) Serial.println("Unable to find address for insideThermometer");

  // show the addresses we found on the bus
  Serial.print("Device 0 Address: ");
  printAddress(insideThermometer);
  Serial.println();

  // set the resolution to 9 bit (Each Dallas/Maxim device is capable of several different resolutions)
  sensors.setResolution(insideThermometer, 9);
 
  Serial.print("Device 0 Resolution: ");
  Serial.print(sensors.getResolution(insideThermometer), DEC);
  Serial.println();
}

// function to print the temperature for a device
void printTemperature(DeviceAddress deviceAddress)
{
  // method 1 - slower
  //Serial.print("Temp C: ");
  //Serial.print(sensors.getTempC(deviceAddress));
  //Serial.print(" Temp F: ");
  //Serial.print(sensors.getTempF(deviceAddress)); // Makes a second call to getTempC and then converts to Fahrenheit

  // method 2 - faster
  float tempC = sensors.getTempC(deviceAddress);
  Serial.print("Temp C: ");
  Serial.print(tempC);
  Serial.print(" Temp F: ");
  Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit
}
/*
 * Main function. It will request the tempC from the sensors and display on Serial.
 */
void loop(void)
{
  // call sensors.requestTemperatures() to issue a global temperature
  // request to all devices on the bus
  Serial.print("Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println("DONE");
 
  // It responds almost immediately. Let's print out the data
  printTemperature(insideThermometer); // Use a simple function to print out the data
}

// function to print a device address
void printAddress(DeviceAddress deviceAddress)
{
  for (uint8_t i = 0; i < 8; i++)
  {
    if (deviceAddress[i] < 16) Serial.print("0");
    Serial.print(deviceAddress[i], HEX);
  }
}
 Arduino web termometras
PranešimasParašytas: 2017 08 04, 19:49 Pranešti apie taisyklių pažeidimą Atsakyti su citata
krienas
Patyręs dalyvis
Patyręs dalyvis
Peržiūrėti vartotojo aprašymą Siųsti asmeninį pranešimą
Supratau... Very Happy
 Arduino web termometras
PranešimasParašytas: 2017 08 08, 19:44 Pranešti apie taisyklių pažeidimą Atsakyti su citata
vilius99
Dažnas dalyvis
Dažnas dalyvis
Peržiūrėti vartotojo aprašymą Siųsti asmeninį pranešimą
Norėjau paklausti kelių dalykų apie arduino ir DS18B20 jutiklius.

Kokį naudoji valdiklį ir interneto plokšte? Gal teko naudoti arduino nano su ethernet shieldų? Galvoju jį imti vien dėl mažesnio dydžio.

Ar yra būdas jutiklio adresą priskirti programos "setup" dalyje sudedant iš atskirų baitų. Norėčiau jutiklių sąrašą leisti vartotojui saugoti savo plc ir jį nusiskaityti iš kito valdiklio.
 Arduino web termometras
PranešimasParašytas: 2017 08 09, 08:11 Pranešti apie taisyklių pažeidimą Atsakyti su citata
AlgisL
Senbuvis
Senbuvis
Peržiūrėti vartotojo aprašymą Siųsti asmeninį pranešimą
Koks skirtumas ar Nano ar Micro ar Uno naudosi, kai Micro atveju atmega kiek kitokia, bet 99% bibliotekinio programinio kodo pilnai suderinama.
Kazkiek skirtumu yra del treciuju saliu gamintu klonu USB<>SerialTTL keitikliuose ir ju darbe, pvz su Win10.
DS18X20 adresus gali saugoti ir EEPROM'e, o juos priskirti automatiskai per f-ja rasti nauja ir priskirti i konkrecia vieta ar vietoj neesamo.
Kas verta is karto pasidaryti Arduino, tai DTR - RESET grandineje ideti jungikli.
Pradėti naują temą  Atsakyti į pranešimą
 
Forumo sistema: phpBB
 „Google“ paieška forume
 Kas naujesnio?
 Naujos temos forume

Global electronic components distributor – Allicdata Electronics

Electronic component supply – „Eurodis Electronics“

LOKMITA – įvairi matavimo, testavimo, analizės ir litavimo produkcija

Full feature custom PCB prototype service

GENERAL FINANCING BANKAS

Mokslo festivalis „Erdvėlaivis Žemė

LTV.LT - lietuviškų tinklalapių vitrina

„Konstanta 42“

Technologijos.lt

Buitinė technika ir elektronika internetu žemos kainos – Zuza.lt

www.esaugumas.lt – apsaugok savo kompiuterį!

PriedaiMobiliems.lt – telefonų priedai ir aksesuarai

„Deinavos baldai“ — šeimos baldai

FS 22 Tractors
Farming Simulator 19 Mods, FS 22 Maps, FS22 Mods
ETS2 Mods
ETS2 Trucks, ETS2 Bus, Euro Truck Simulator 2 Mods
FS22 Tractors
Farming Simulator 22 Mods, FS22 Maps, FS22 Trucks
VAT calculator
VAT number check, What is VAT, How much is VAT
Paskola internetu
Vartojimo paskola, paskola automobiliui, paskola būsto remontui
Thermal monocular
Thermal vision camera,
Night vision ar scope,
Night vision spotting scope
FS22 Mods
FS22 Harvesters, FS22 Tractors Mods, FS22 Maps Mods
FS22 Mods
FS22 Maps,
FS22 Harvesters,
FS22 Tractors
Dantų protezavimas
All on 4 implantai,
Endodontija mikroskopu,
Dantų implantacija
Sims 4 Mods
Sims 4 CC Clothes,
Sims 4 Hair CC,
Sims 4 Skill Cheat
Optic sight
Binoculars for hunting elk,
Best compact binoculars,
Riflescope hunting
Reklama
‡ 1999– © Elektronika.lt | Autoriaus teisės | Privatumo politika | Atsakomybės ribojimas | Turinys | Reklama | Kontaktai LTV.LT - lietuviškų tinklalapių vitrina
Script hook v, Openiv, Menyoo
gta5mod.net
Farming Simulator 2019 Mods, FS22 Mods, FS22 Maps
farmingsimulator19mods.fr
Optical filters, UV optics, electro optical crystals
www.eksmaoptics.com
Reklamos paslaugos
SEO sprendimai

www.addad.lt
Elektroninių parduotuvių optimizavimas „Google“ paieškos sistemai
www.seospiders.lt
FS22 mods, Farming simulator 22 mods,
FS22 maps

fs22.com
Reklama


Reklama