- This topic has 1 reply, 2 voices, and was last updated 7 years ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › AVR › Interfacing BH1750 sennsor with Atmega8
Hi,
I am trying to interface Atmega8 with BH1750 digital light sensor and displayin intensity on LCD.
I am getting decimel values on LCD.But I want to display fraction values. I tried a lot but failed..
can anybody please help. following is main program …
//main.c
for displaying fraction values on LCD you have to do some juggling with digits.
first get the final answer in float (may be with 2 digit after decimal point)
now multiply this answer with 100 – so you will get final value without decimal point
now convert all digits of this value into ASCII characters and print these values
one by one on LCD with one decimal point in between