# My board is weird?

**URL:** <https://community.sparkfun.com/t/my-board-is-weird/21507>\
**Category:** Arduino\
**Created:** [August 3, 2011, 4:24pm UTC](https://community.sparkfun.com/t/my-board-is-weird/21507 "2011-08-03T16:24:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![moorejohn90](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@moorejohn90](https://community.sparkfun.com/u/moorejohn90)\
**Post date:** [August 3, 2011, 4:24pm UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/1 "2011-08-03T16:24:41Z")

</div>

Hi everyone, I got a problem.

My UNO didn’t work in many way(today that mean that was fine in the last two day).

1.It doesn’t read analog value (A0 - A5). It was fine in the last five days.

2.It doesn’t respond serial command - I write a program like, led will open when I sent ‘o’ and close when I sent ‘c’.

But it will work without serial command. Like in the following program.

//\<\>

void setup()

{

pinMode(13, OUTPUT);

}

void loop()

{

digitalWrite(13, HIGH); delay(5000);

digitalWrite(13, LOW); delay(5000);

}

//\<

//\<

void setup()

{ pinMode(9, OUTPUT);

Serial.begin(9600);

}

void loop()

{while(Serial.available()\<1)

{

int a=Serial.read();

if (a==‘n’)

digitalWrite(9, HIGH);

else if(a==‘b’)

digitalWrite(9, LOW);

else

Serial.println(“no one”);

}

}

//\<\>

Is my UNO is dead?

---

<div class="post-metadata">

**Author:** ![leon\_heller](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/leon_heller/32/7602_2.png) [@leon\_heller](https://community.sparkfun.com/u/leon_heller)\
**Post date:** [August 3, 2011, 4:50pm UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/2 "2011-08-03T16:50:52Z")

</div>

You might have damaged some inputs, try a new AVR chip in it. Make sure that you get one with the bootloader.

---

<div class="post-metadata">

**Author:** ![moorejohn90](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@moorejohn90](https://community.sparkfun.com/u/moorejohn90)\
**Post date:** [August 3, 2011, 5:04pm UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/3 "2011-08-03T17:04:58Z")

</div>

Is there any way of checking my board is dead or not, I live in Myanmar and it is hard to get new one (i bought from Thailand).

Thanks :mrgreen:

---

<div class="post-metadata">

**Author:** ![leon\_heller](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/leon_heller/32/7602_2.png) [@leon\_heller](https://community.sparkfun.com/u/leon_heller)\
**Post date:** [August 3, 2011, 5:13pm UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/4 "2011-08-03T17:13:46Z")

</div>

Have you checked to see if you can read those pins as digital inputs?

---

<div class="post-metadata">

**Author:** ![moorejohn90](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@moorejohn90](https://community.sparkfun.com/u/moorejohn90)\
**Post date:** [August 3, 2011, 5:36pm UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/5 "2011-08-03T17:36:38Z")

</div>

Hi Leon Heller, It is work(digitalRead).

Moore John

---

<div class="post-metadata">

**Author:** ![leon\_heller](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/leon_heller/32/7602_2.png) [@leon\_heller](https://community.sparkfun.com/u/leon_heller)\
**Post date:** [August 3, 2011, 6:08pm UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/6 "2011-08-03T18:08:57Z")

</div>

t looks as though you might have damaged the ADC inputs, then.

---

<div class="post-metadata">

**Author:** ![JChristensen](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@JChristensen](https://community.sparkfun.com/u/JChristensen)\
**Post date:** [August 3, 2011, 7:40pm UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/7 "2011-08-03T19:40:57Z")

</div>

You may or may not have hardware problems, but that second program probably won’t work as desired. If Serial.available() is \< 1, then there are no characters to read. I’d use:```  
while (Serial.available() \> 0) {…}

```auto

```

---

<div class="post-metadata">

**Author:** ![trialex](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@trialex](https://community.sparkfun.com/u/trialex)\
**Post date:** [August 3, 2011, 11:08pm UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/8 "2011-08-03T23:08:50Z")

</div>

Use the Serial.Read example built into the Arduino IDE to eliminate the possibility of coding errors.

Just to check, you are trying to read the ANALOG IN pins yeah, not the digital ones? You say they were working a few days ago, but still…

---

<div class="post-metadata">

**Author:** ![moorejohn90](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@moorejohn90](https://community.sparkfun.com/u/moorejohn90)\
**Post date:** [August 4, 2011, 2:16am UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/9 "2011-08-04T02:16:15Z")

</div>

Hi everyone, I got another problem.

Analog pin is work again, according to the following sketch

\<\>

int sensor;

void setup()

{ Serial.begin(9600);

pinMode(9, OUTPUT);

}

void loop()

{ sensor=analogRead(1); //Light Dependent Resistor

sensor=map(sensor,0,1023,0,10);

delay(1000);

Serial.println(sensor);

if (sensor\<=2)

{

digitalWrite(9, HIGH);

}

else { digitalWrite(9, LOW);}

}

The led is shiny bright when I cover the LDR with my hand(serial monitor show ‘2’). But I got a problem with using serial command, as below.

int lead=9;

void setup()

{

Serial.begin(9600);

}

void loop()

{

if (Serial.available() \>0)

{

char c=Serial.read();

if (c==‘o’)

{

digitalWrite(lead, HIGH);

}

else if(c==‘c’)

{

digitalWrite(lead, LOW);

}

else Serial.println(“Others”);

}

}

When I sent other character not ‘o’ and ‘c’, the serial monitor respond as I desired(“Others”).

When I sent ‘o’, the lead is not absolutely dead, I notice little light that is not bright like in the working program.

That means, the lead in the same pin is bright that is trigger by UNO’s IO (in my sketch LDR) and not(not bright like previous) bright that is trigger by serial command.

Help me.

Moore John.

---

<div class="post-metadata">

**Author:** ![leon\_heller](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/leon_heller/32/7602_2.png) [@leon\_heller](https://community.sparkfun.com/u/leon_heller)\
**Post date:** [August 4, 2011, 7:40am UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/10 "2011-08-04T07:40:00Z")

</div>

You should use Code tags to make your code readable - [code] [/code] round it (remove the spaces).

---

<div class="post-metadata">

**Author:** ![n1ist](https://avatars.discourse-cdn.com/v4/letter/n/5daacb/32.png) [@n1ist](https://community.sparkfun.com/u/n1ist)\
**Post date:** [August 4, 2011, 11:35am UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/11 "2011-08-04T11:35:10Z")

</div>

In the second sketch, you forgot to set the pin as an output. Therefore, instead of setting it high, you are turning on the pullup, which barely lets through enough current to light the LED.

/mike

---

<div class="post-metadata">

**Author:** ![moorejohn90](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@moorejohn90](https://community.sparkfun.com/u/moorejohn90)\
**Post date:** [August 5, 2011, 3:59am UTC](https://community.sparkfun.com/t/my-board-is-weird/21507/12 "2011-08-05T03:59:07Z")

</div>

Hi, Thanks you to leon\_heller,n1ist,JChristensen and trialex.

Finally all of your help can solve my problem.

I forgot to add (pinMode(led,OUTPUT) and (while(Serial.available()\<1) made the problem.

I am very glad and thanks to all of your help.

With best wishes,

Moore John.
