getting started


I recently started with programming with arduino Uno.
Does somebody can get me a good tutorial, for how to use what for what.
I was trying to display temperature (with aLM35 sensor) a 7segment 4 digit display, but all the digit showed the same number.

7 Segment -->>

The best thing to do would be to post the code that didn't work and we can see if we can find the problem.

long previousMillis = 0;
Change to:
unsigned long previousMillis = 0;


You seem to be writing to the LEDs only when the time interval elapses -admittedly it is a short interval of 10 millisecs - but the LEDs may need to be updated much more frequently. I suggest taking them out of the timing IF.

Can you get the LEDs to work properly in a simple program without any temperature measurement?

I wonder if this line

if(temp>(20) && temp<(21)){

should be

if(temp>(20.0) && temp<(21.0)){

because temp is a float

Because analogRead() returns an int I suspect there is no need to use floats at all.


You're not ever writing digit1 or digit2 back to LOW.

int = integer
unsigned = 0, 1, 2, 3, ...

You need to study and understand "multiplexing" Search for it on the Internet.

Here is a sample result:

nothing is working the way it should be.

I understand your frustration.

I suggest you work through several of the examples that come with the Arduino IDE. Maybe start with the simple BLINK example. If you have questions then we will try to help.

You may find something useful on the CplusPlus website


The serial monitor is very useful in trouble shooting issues. You may want to get the LM35 output sent to the serial monitor first to see if it is working/outputting as expected. Once the serial monitor is showing what is expected, then work on the display part.