#avr Logs

Sep 30 2019

#avr Calendar

06:35 PM julius: hi
06:40 PM djph: o/
06:40 PM julius: the code in this link [1] shows how to read the LM35 temperature sensor. i need a little change to send the data via a hc05 bluetooth module. when celsius is a float in this: celsius = (ADC_Read(0)*4.88); how many digits end up in celsius or how many are in (int) celsius? [1]: https://www.electronicwings.com/avr-atmega/lm35-temperature-sensor-interfacing-with-atmega1632
06:52 PM djph: julius: int is whole numbers only. It will truncate any mantissa in the original float.
06:52 PM julius: right
06:52 PM julius: so it will be a two digit number?
06:55 PM djph: it'll be however many digits are necessary for the set of integers (1,2,3,...99,100,101...)
06:56 PM djph: on an AVR chip, IIRC, "int" is 16 bits, signed (-32,768 to 32,767)
06:58 PM djph: ultimately, it's just 1s and 0s; so bit-shifting and casting may work to transfer the float properly.
07:11 PM [1]MrMobius is now known as MrMobius
07:15 PM cehteh: mhm
08:16 PM vmt: https://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_reg_usage
08:18 PM vmt: for avr-gcc. i would imagine other compilers targeting avr use the same sizes
11:50 PM day__ is now known as day