Greetings,
I just got my first arduino board, the Nano, and for one of my first projects I wanted to make a digital thermometer. I have some C/C++ knowledge, but it is limited. I am using an LM34 temp sensor and I want to drive a 2-digit 7-segment LED display (Common Cathode).
The part number is obscure, and I cannot find a data sheet. Assume I can figure out which pin goes to what LED, which isn't a difficult task. That is not the problem.
I will be driving it with two 74LS48, which is a BCD to 7-segment display driver. This is because there are only 12 digital I/O pins (leaving the possibility for 3 displays)
Say the temp sensor reads 0.7V for 70F, and I use the 1.1V internal analogReference. The arduino would ideally detect (0.7V / 1.1V)*1023 = (651)10 or (1010001011)2 on its ADC output.
I would want to display 70 on the display, which would be BCD number 0111 0000 (This is the data which would be sent in parallel to the two 74LS48s)
Say the program does the following and converts the analogRead to a familiar decimal (integer) temperature reading:
temp = analogRead(LM34_pin); // stores the digitized (0 - 1023) analog reading from the LM34
fahrenheit = (100*temp*(vref))/1023; // calculates the actual fahrenheit temperature
How would I convert the decimal 70 to a form that will drive the 8 pins driving the display drivers (drive!)? (I can skip the conversion altogether if need be)
I have been searching the forums and internet for code to steal, but I have not had any luck. I would appreciate any help.
Thanks in advance.