Author Topic: Improved/optimized DS18B20/1Wire read  (Read 19387 times)

TomWS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1854
Re: Improved/optimized DS18B20/1Wire read
« Reply #30 on: January 14, 2019, 09:16:16 AM »
For future ref, you could have also done:
Code: [Select]
byte dsaddr[] = {0x10, 0x90, 0x51, 0x59, 0x03, 0x08, 0x00, 0xCB};

Apprentice17

  • Newbie
  • *
  • Posts: 5
Re: Improved/optimized DS18B20/1Wire read
« Reply #31 on: January 15, 2019, 02:28:51 AM »
That's what I tried first, but it didn't work. Couldn't compile it.
Converting the HEX to DEC manually did the trick ;)

TomWS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1854
Re: Improved/optimized DS18B20/1Wire read
« Reply #32 on: January 15, 2019, 08:19:05 AM »
That's what I tried first, but it didn't work. Couldn't compile it.
If it didn't compile, you had some other error in your code.  This is a proper 'C' construct.