This is my first post and I am a complete Arduino beginner. Sorry if this has been already discussed. Using the Search function could not find any relevant information.
I have a two-digit common anode LED display. I've connected the b and c segments of the rightmost digit to digital pins 11 and 12, and the common anode to +5V. By using a program similar to the blinking LED sketch, I am able to turn off and on these two segments (I see a blinking "1"). My intention is to use this LED display together with a DS18B20 temperature sensor to display the temperature readings. How can I do this?
Thank you, MikMo. As I've already said, being a beginner, I am not sure that I'd be able to re-design the "arduino_7_segment_output" from the common cathode to common anode (my display is a common anode one).
As a starting point, just get the displays working. Start with one digit, then move to two. Connect each pin (cathode) from the display to a pin on the arduino. Conenct the common anode to +5v. When you want to light a segment set the corresponding pin low.
Then move to two segments, both directly driven. You should have just enough digital pins to do it directly, and therefore don't need the 595 chip in the middle. Remember though that if you use pins 0 and 1 you can't use serial transmission, and don't have the display plugged in while programming.
Do the segments have separate anodes? If so then you can do some simple multiplexing. Connect the corresponding segments of the displays to the same pin (eg both "a"s together), and connecting the anodes to separate I/O pins. Then you can set one of the anodes to high, and the corresponding display will light up, then you can set that anode low, and the second high, and that display will light up. Do it really fast, and it will look like both displays are on at the same time.
As a starting point, just get the displays working. Start with one digit, then move to two. Connect each pin (cathode) from the display to a pin on the arduino. Conenct the common anode to +5v. When you want to light a segment set the corresponding pin low.
Then move to two segments, both directly driven. You should have just enough digital pins to do it directly, and therefore don't need the 595 chip in the middle. Remember though that if you use pins 0 and 1 you can't use serial transmission, and don't have the display plugged in while programming.
Do the segments have separate anodes? If so then you can do some simple multiplexing. Connect the corresponding segments of the displays to the same pin (eg both "a"s together), and connecting the anodes to separate I/O pins. Then you can set one of the anodes to high, and the corresponding display will light up, then you can set that anode low, and the second high, and that display will light up. Do it really fast, and it will look like both displays are on at the same time.
Trialex,
Thank you very much. I think that I understand what I am supposed to do. Yes, the two digits have separate anodes. Do I need an additional transistor or something else? I've measured current from the Atmega160 pin and one of the LED segments--it was around 9.5 mA when the segment was active. Does that mean that the pin connected to one of the anodes would have to source 7x9.5mA (if I want do display "8"--all seven segments active)? I've found somewhere that arduino can source/sink 30 mA.
Thank you very much. I think that I understand what I am supposed to do. Yes, the two digits have separate anodes. Do I need an additional transistor or something else? I've measured current from the Atmega160 pin and one of the LED segments--it was around 9.5 mA when the segment was active. Does that mean that the pin connected to one of the anodes would have to source 7x9.5mA (if I want do display "8"--all seven segments active)? I've found somewhere that arduino can source/sink 30 mA.
Good practice would be to use a transistor. You could limit the current going to each segment so that the total is less than 30mA. Depends on how bright you want the segments to be, and how complicated you are willing to go.