Метеостанция на Arduino mega nrf24l01+ цветной tft дисплей 3,5"

#define DEVICE_DISCONNECTED_C -127
Может с адресом косяк ?

12 DeviceAddress sensor = {0x28, 0xFF, 0x68, 0x6A, 0x84, 0x16, 0x5, 0x69}; //адрес датчика.

Это вы то же из интернета взяли или отсканировали адрес именно вашего датчика ?

Сначала погоняйте скетч - Arduino-Temperature-Control-Library/Tester.ino at master · milesburton/Arduino-Temperature-Control-Library · GitHub

он должен найти все ваши датчики и показать температуру с них.

127 или -127?

выдает “-127”

Нет связи с датчиком !

погонял скетч [Arduino-Temperature-Control-Library/Tester.ino at master · milesburton/Arduino-Temperature-Control-Library · GitHub](http://out.arduino.ru/? выдает в монитор порта
Requesting temperatures…DONE
Temperature for device: 0
Temp C 73.00 Temp F: 163.40

И всё ? Там в Setup я вижу строки

Serial.print("Found ");
Serial.print(numberOfDevices, DEC);
Serial.println(" devices.");

У вас где вывод о количестве устройств ?
Если устройства обнаружены - должен быть выведен список их адресов …

больше ничего не выдает

это значит он не находит датчик?

Покажите тогда загружаемый вами скетч ! Не может этот скетч что в примере не выводить “шапку” !!!

Спойлер
#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
#define TEMPERATURE_PRECISION 9 // Lower resolution

// 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);

int numberOfDevices; // Number of temperature devices found

DeviceAddress tempDeviceAddress; // We'll use this variable to store a found device address

void setup(void)
{
  // start serial port
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library Demo");

  // Start up the library
  sensors.begin();

  // Grab a count of devices on the wire
  numberOfDevices = sensors.getDeviceCount();

  // locate devices on the bus
  Serial.print("Locating devices...");

  Serial.print("Found ");
  Serial.print(numberOfDevices, DEC);
  Serial.println(" devices.");

  // report parasite power requirements
  Serial.print("Parasite power is: ");
  if (sensors.isParasitePowerMode()) Serial.println("ON");
  else Serial.println("OFF");

  // Loop through each device, print out address
  for (int i = 0; i < numberOfDevices; i++)
  {
    // Search the wire for address
    if (sensors.getAddress(tempDeviceAddress, i))
    {
      Serial.print("Found device ");
      Serial.print(i, DEC);
      Serial.print(" with address: ");
      printAddress(tempDeviceAddress);
      Serial.println();

      Serial.print("Setting resolution to ");
      Serial.println(TEMPERATURE_PRECISION, DEC);

      // set the resolution to TEMPERATURE_PRECISION bit (Each Dallas/Maxim device is capable of several different resolutions)
      sensors.setResolution(tempDeviceAddress, TEMPERATURE_PRECISION);

      Serial.print("Resolution actually set to: ");
      Serial.print(sensors.getResolution(tempDeviceAddress), DEC);
      Serial.println();
    } else {
      Serial.print("Found ghost device at ");
      Serial.print(i, DEC);
      Serial.print(" but could not detect address. Check power and cabling");
    }
  }

}

// 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);
  if (tempC == DEVICE_DISCONNECTED_C)
  {
    Serial.println("Error: Could not read temperature data");
    return;
  }
  Serial.print("Temp C: ");
  Serial.print(tempC);
  Serial.print(" Temp F: ");
  Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit
}

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");


  // Loop through each device, print out temperature data
  for (int i = 0; i < numberOfDevices; i++)
  {
    // Search the wire for address
    if (sensors.getAddress(tempDeviceAddress, i))
    {
      // Output the device ID
      Serial.print("Temperature for device: ");
      Serial.println(i, DEC);

      // It responds almost immediately. Let's print out the data
      printTemperature(tempDeviceAddress); // Use a simple function to print out the data
    }
    //else ghost device! Check your power requirements and cabling

  }
}

// 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);
  }
}

Как могут не отобразиться строки 22 31 33 34 35 ???

#include <OneWire.h>
	#include <DallasTemperature.h>
	

	// Data wire is plugged into port 2 on the Arduino
	#define ONE_WIRE_BUS  2
	#define TEMPERATURE_PRECISION  9 // Lower resolution
	

	// 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);
	

	int numberOfDevices; // Number of temperature devices found
	

	DeviceAddress tempDeviceAddress; // We'll use this variable to store a found device address
	

	void  (()
	{
	  // start serial port
	 Serial.begin(9600);
	 Serial.println ("Dallas Temperature IC Control Library Demo");
	

	  // Start up the library
	 sensors.begin();
	

	  // Grab a count of devices on the wire
	  numberOfDevices = sensors.getDeviceCount();
	

	  // locate devices on the bus
	  Serial.print("Locating devices...");
	

	  Serial.print("Found ");
	  Serial.print(numberOfDevices, DEC);
	  Serial.println(" devices.");
	

	  // report parasite power requirements
	  Serial.print("Parasite power is: ");
	  if (sensors.isParasitePowerMode()) Serial.println("ON");
	  else Serial.println("OFF");
	

	  // Loop through each device, print out address
	  for (int i = 0; i < numberOfDevices; i++)
	  {
	    // Search the wire for address
	    if (sensors.getAddress(tempDeviceAddress, i))
	    {
	      Serial.print("Found device ");
	      Serial.print(i, DEC);
	      Serial.print(" with address: ");
	      printAddress(tempDeviceAddress);
	      Serial.println();
	

	      Serial.print("Setting resolution to ");
	      Serial.println(TEMPERATURE_PRECISION, DEC);
	

	      // set the resolution to TEMPERATURE_PRECISION bit (Each Dallas/Maxim device is capable of several different resolutions)
	      sensors.setResolution(tempDeviceAddress, TEMPERATURE_PRECISION);
	

	      Serial.print("Resolution actually set to: ");
	      Serial.print(sensors.getResolution(tempDeviceAddress), DEC);
	      Serial.println();
	    } else {
	      Serial.print("Found ghost device at ");
	      Serial.print(i, DEC);
	      Serial.print(" but could not detect address. Check power and cabling");
	    }
	  }
	

	}
	

	// 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);
	  if (tempC == DEVICE_DISCONNECTED_C)
	  {
	    Serial.println("Error: Could not read temperature data");
	    return;
	  }
	  Serial.print("Temp C: ");
	  Serial.print(tempC);
	  Serial.print(" Temp F: ");
	  Serial.println(DallasTemperature::toFahrenheit(tempC)); // Converts tempC to Fahrenheit
	}
	

	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");
	

	

	  // Loop through each device, print out temperature data
	  for (int i = 0; i < numberOfDevices; i++)
	  {
	    // Search the wire for address
	    if (sensors.getAddress(tempDeviceAddress, i))
	    {
	      // Output the device ID
	      Serial.print("Temperature for device: ");
	      Serial.println(i, DEC);
	

	      // It responds almost immediately. Let's print out the data
	      printTemperature(tempDeviceAddress); // Use a simple function to print out the data
	    }
	    //else ghost device! Check your power requirements and cabling
	

	  }
	}
	

	// 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);
	  }
	}

скажите, а как проверить датчик годный или нет, он хоть и подключен питание к 3,3 в, но тестером я померил, там около 5 в.

Что ЭТО в 24 строке у вас ???

извините, это так скачалось, а загружаю void setup()

как может не выполниться строка 28 вашего скетча ?

вот то что выдает, внизу виден кусок программы

А если отмотать вывод назад к первым строкам ?
Или добавьте delay(10000) в самый конец setup

в какой номер строки поставить?

85 по вашему скетчу