Hi to all, I am new at arduino coding. I been using it since a week a ago. And im really trying hard to learn this cool device. So i decided to start my first simple project. It is a Temperature controlled project and im having trouble displaying the current reading temperature on 7 segment, i have read alot of instructables about this and i really cant use it properly. This is my code without the 7 segment display. help me out in understanding on how to use 2 digit 7 segment display on arduino. THANKS in advance.
Hi, this is my circuit, i still dont have a 7 segment display in this circuit. Sorry for violating some rules. Thank you. The LED at pin 12 represents the 12V fan.
Here's one way, using 2 shift registers and 2 separate displays.
Code is simple, just use SPI.transfer (or shiftout) to send out 2 bytes.
No multiplexing needed in the code.
CrossRoads:
Here's one way, using 2 shift registers and 2 separate displays.
Code is simple, just use SPI.transfer (or shiftout) to send out 2 bytes.
No multiplexing needed in the code.
Shall i connect the registers like this on my arduino? thank you
Well, due to the lousy nature of fritzing not putting any IO pin names in symbols, I can only guess that it's correct if you followed my schematic. It is nicely drawn.
Don't forget 0.1uF caps on the power supply pins.
You used 8,9,10 instead of 10, 11, 13, so you'll need to use shiftout() instead of SPI.transfer() as I noted in my schematic.
Your call, it's just slower to update.
Hi,
I notice you are using analogRead to check the switch position.
The inputs being either LOW or HIGH, you risk the fact that the contact resistance of the switch will not always be zero.
A little contact resistance will see an analog value >0.
If all you want is the switch to select your set temperature, then assign the A1 to A5 as INPUT and digitalRead the pins.
This will allow for some contact resistance to occur and the voltage at the inputs to rise a little and you will still have a digital LOW in.
Your if statements will have to be changed to temp1 == LOW.