

І для Atolic TrueStudio обрати "NewLib standart": * USER CODE END WHILE */ /* USER CODE BEGIN 3 */ Printf( " Temperature for the device 2 (index 1) is: %.2f \r\n ", HAL_GetTick(), DT_GetTempCByIndex( &dt, 1)) Printf( " Temperature for the device 1 (index 0) is: %.2f \r\n ", HAL_GetTick(), DT_GetTempCByIndex( &dt, 0))

We use the function ByIndex, and as an example get the temperature from the first sensor only. After we got the temperatures, we can print them here. Printf( " \r\n DONE \r\n ", HAL_GetTick()) Printf( " Requesting temperatures.", HAL_GetTick()) ĭT_RequestTemperatures( &dt) // Send the command to get temperatures call DT_RequestTemperatures(&dt) to issue a global temperature // request to all devices on the bus * Infinite loop */ /* USER CODE BEGIN WHILE */ while ( 1) Printf( " Device 1 Resolution: %d \r\n ", HAL_GetTick(), DT_GetResolution( &dt, insideThermometer)) Printf( " Device 1 Address: ", HAL_GetTick()) Printf( " Unable to find address for Device 1 \r\n ", HAL_GetTick()) If ( !DT_GetAddress( &dt, insideThermometer, 1)) Printf( " Device 0 Resolution: %d \r\n ", HAL_GetTick(), DT_GetResolution( &dt, insideThermometer)) set the resolution to 12 bit (Each Dallas/Maxim device is capable of several different resolutions)ĭT_SetResolution( &dt, insideThermometer, 12, true) Printf( " Device 0 Address: ", HAL_GetTick()) Printf( " Unable to find address for Device 0 \r\n ", HAL_GetTick()) If ( !DT_GetAddress( &dt, insideThermometer, 0)) \r\n ", HAL_GetTick(), DT_GetDeviceCount( &dt)) Printf( " Locating devices.", HAL_GetTick()) Printf( " OneWire no devices :( \r\n ", HAL_GetTick())

Printf( " OneWire devices are present :) \r\n ", HAL_GetTick()) Printf( " Debug UART2 is OK! \r\n ", HAL_GetTick())
