problems on pin 0

hey,

i got an led in a bigger project, attached to pin 0.

when i just try the blink example, everything works fine.

but when i try to run it in my bigger project, the led is always on, not listening to any orders.

whats probably the mattter?

is there a solution to put the led on a analog in pin, but to write analog out to it?

thanks!!!

Do you use serial communication in your project ?

If so ten that is probably the problem. Pin 0 is one of the serial TX / RX lines.

no, i uncommentet every Serial. command.

As MikMo said, you have your LED on your serial receive (RX) line. This line is probably being pulled high by your Arduino's serial connection (this is the default state for a serial line), which can weakly light an LED.

  • Ben

is there a possibility to write analog to a analog input pin?

so i could hang my led to an analog in pin.

Analog pins can be used as digital pins 14 - 19 (if I remember the numbers correctly).

The RX pin (can't remember if it's 0 or 1) may be driven by the USB/rs232 chip, which could cause the issue you are seeing. To successfully use pins 0 and 1, change the power jumper to "ext" and use a power source other than USB.

-j

No, but you can use a "analog input" pin as a digital output and drive your LED that way. You can simulate outputing an analog voltage if you use a designated PWM output pin. In such a case the LED brightness will be approximately proportional to the PWM duty cycle, assuming you are using a high enough frequency PWM to avoid a noticable flicker.

  • Ben

thank you

the problem is, that i'm running out of pins (even i'm using three shift registers.)

so i can write digitalWrite(0, HIGH) but connect it to the pin 0 of the analog input side?

thank you very much.

so i can write digitalWrite(0, HIGH) but connect it to the pin 0 of the analog input side?

No, you can write

digitalWrite(14, HIGH)

and connect your LED to analog input pin 0. As kg4wsv said, analog pins can be used as digital pins 14 - 19 (so analog input 0 is digital pin 14, analog input 1 is digital pin 15, etc).

  • Ben

thank you very much. this will really help me!