Arduino UNO sketch doesn't run after upload!

Hi !

I need some help from experts, and I really hope someone can find a solution to my problem. I appreciate any and all help.

I'm a Portuguese Electronics Student and i just started using micro-controllers, so I decided to try out Arduino, and bought an Arduino Uno.
For a first project to start using Arduino e sketched a Temperature Sensor using an LM35 and an 16x2 LCD. I sketch my program and waited a while for it to upload, and it said "Upload successful", but the problem is that nothing ran on the Arduino. I looked in the troubleshooting guide, and i didn't find solution unfortunately .

I already checked all my jumpers and they are all OK, i also uploaded the Blinking Led project and it did run, so the ATMEGA is fine. I really don't know what else to do, because i think my sketch is fine.

here's the sketch so you can see if its ok:

#include <LiquidCrystal.h>

int sensor = 0;
int Ventrada;
float Temperatura;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()
{
lcd.begin(16, 2);
lcd.print("A Iniciar...");
delay(3000);
lcd.print("Temperatura: ");
}

void loop()
{
Ventrada = analogRead (sensor);
Temperatura=(500*Ventrada)/1023;
lcd.setCursor(0, 1);
lcd.print(Temperatura);
lcd.print(" C"); // Celsius

delay(1000);
}

Can anyone help me?
By the way, the led L is constantly on, in the colour red.

Another doubt i have is, i connect my arduino board to my PC with the usb cable, so is the right programer AVRISP mkll ?

Thanks, Much Appreciated to everyone.

Put a Serial.begin(9600); line in the setup, then a couple of Serial.println("where the program is at"); in a couple of places and review the serial output with the serial monitor.

I suspect that you may have an issue with something else.

Have you successfully got programs to upload and run which just display output on the Arduino Serial monitor?

Have you ever got any display from your LCD device?
I have a couple of 16x2 LCD screens which are PC1602-H versions that need a -1.0v supply to make the display visible. I did not realize that when I bought them or I would have chosen different versions - i.e. not the -H version.

...R

Sketch works fine with a Arduino Uno and a LM35,and a 1602 display

Thanks for all your interest in helping me, I'm really appreciated ! As a newbie in Arduino and micro-controllers all your help worth a lot to me !!

@ChilliTronix
i'll do that, but can you clarify a question for me?
What's the difference in use Serial.printIn and Serial.print?

@Robin2
I didn't even try Arduino serial monitor :s my fault i know, but tomorrow i'll try it and let you know.
About the LCD the one i'm using is PC1602-N (at least it's what it sais in is back) and it was offered me by a friend so i really don't know for sure if it's working fine. It turns on when the pin 15 and 16 are connected to +V and GND, but i never saw it displaying text.

@gonnie08
Really ? I'm really happy to know it !!
Did you try it in a Arduino UNO ?
So can you tell me what am i doing wrong ?

Find a datasheet for the PC1602-N just to check everything, including the connections.

As far as I know it is only the -H variants that need the negative voltage - but I am not certain.

...R

Hi
you have the libraries on the good place??
and Yes I have it running on the UNO ,works perfectly
your code is fine

marco_mathiaz:
Hi !

I need some help from experts, and I really hope someone can find a solution to my problem. I appreciate any and all help.

::::SNIP::::

marco_mathiaz,
next time you post code please use "markup". Pleaes see the image attached.

Jesse

arduino_markup.png

Through in some Serial.prints to see if the code is working and the LCD is futzed, or if it's the actual code.

Not sure what model LCD I have, but I had to hook up V0 to a pot to adjust the contrast, then when i figured out the signal to send, I just had a pin do it.

Look at http://arduino.cc/en/Tutorial/LiquidCrystal for a better idea of what I'm talking about.

Marmotjr:
then when i figured out the signal to send, I just had a pin do it.

Does that mean your problem is now solved?

...R

Thanks again for all your help !
I've been studying because i've been having exams, so i honestly didn't have any opportunity to try your resolutions but i'm planning to pick this project up tomorrow and finally solve this (at least i hope).

@Marmotjr
I will through some serial.prints to see if it's the code or the LCD.
About the pot, i have a 10Kohm pot connected to V0 pin to adjust contrast but the problem is that i really don't get any info at all...
I didn't try Arduino serial monitor as i said, but tomorrow i'll try it and i'll give you and @robin2 some feedback.

@gonnie08
Yes, i do have the libraries in the right location/place.
I'm starting to think that it's the LCD that it's not right.

@jessemonroy650
I'm new at this forum, i didn't know that, but thanks,next time i will markup my code.