LCD

hi, i have a question with #include <LiquidCrystal.h>. my code is below:

void setup() {
lcd.begin(16, 2);
Serial.begin(9600);

for(int i=0;i<=10;i++)
{
lcd.setCursor(0,0);
lcd.print("tomando valor ");
lcd.print(i);
delay(500);
valor*=analogRead(pot);*
delay(500);

  • }*
    //////////////////////////////////////////////////////////////////////////////////////
  • lcd.clear();*
    lcd.print(valor[2]);
    ///////////////////////////////////////////////////////////////////////////////////
    for(int j=0;j<=10;j++)
  • {*
  • Serial.println(valor[j]);*
  • delay(500);*
  • }*
  • }*
    void loop() {
    /////////////////////////////////////////////////////////////////////////////////////
  • //delay(1000);*
  • //lcd.print(valor[2]);*
  • ///////////////////////////////////////////////////////////////////////////////////*
  • }*
    th main problem is when i try to print in the lcd, in the setup start take anlog reads of a pot, and later i try to print a number with lcd.print but it restart all the code, if i erase this line and i put it in the loop is the same thing, it re start all the code, but if i erase the line and change the line for lcd.clear it works!!!
    only lcd.print doesnt work!!!!

I think your code is incomplete, and posted without code tags, but that the array valor has only ten elements, and you're writing to the eleventh element