Easy question

Hi!

I wrote an easy code in C# that turn led on when pc keyboard key is hold down and turn led off when pc keyboard key is released. When i hold the key, arduino tx and rx leds constant blink, because arduino constantly receives data.

My question is will i damage the arduino?

Sorry on my bad english :slight_smile:

No, arduino unlikely to be damaged this way, but I can't say the same about keyboard -);

Why? Can you explain to me?

Do you have a resistor in series with the LED?

niky518:
When i hold the key, arduino tx and rx leds constant blink, because arduino constantly receives data.

Computers are, generally speaking, designed to receive data constantly. What else can they do?

Do you have a resistor in series with the LED?

No, led is connected in pin 13..

Ok then, ty for responses :slight_smile:

No, led is connected in pin 13..

Then disconnect it immediately and put a resistor in series.

OP probably means it's the onboard LED connected to pin 13 which has a resistor in series. If my assumption is false, take the advise of AWOL literally and disconnect the LED, you may destroy the port of the Arduino.

When i hold the key, arduino tx and rx leds constant blink, because arduino constantly receives data.

My question is will i damage the arduino?

No, but why are you doing it this way? Send one value when the key transitions to pressed, and another when the key transitions to released, and nothing in between.

No, but why are you doing it this way? Send one value when the key transitions to pressed, and another when the key transitions to released, and nothing in between.

Probably a stupid question but how to program that?

Then disconnect it immediately and put a resistor in series.

OP probably means it's the onboard LED connected to pin 13 which has a resistor in series. If my assumption is false, take the advise of AWOL literally and disconnect the LED, you may destroy the port of the Arduino.

I'll make so

Probably a stupid question but how to program that?

In the keyPressed event handler, send the lower case version of the key that triggered the event. In the keyReleased event handler, send the upper case version of the key that triggered the event.

In the keyPressed event handler, send the lower case version of the key that triggered the event. In the keyReleased event handler, send the upper case version of the key that triggered the event.

Ty :slight_smile: