Serial input

Since I only have some LEDs to play with I had to be “creative”. So I have tried different ways to program my LEDs to light.

This time I have been using the serial console in the Arduino enviroment software.

This is how it’s works:

By entering the numbers from 0 to 3 I make one of the four LEDs connected to the Arduino to light for some milliseconds.

Here is the code: https://gist.github.com/sjsd/5375179

https://gist.github.com/5375179

It’s not so easy to see on the sketch below, but each LED is connected to a output, then through a resistor back to ground. Each LED is connected to their own output. I have used output 10 to 13.

image

Legg igjen en kommentar

Fyll inn i feltene under, eller klikk på et ikon for å logge inn:

WordPress.com-logo

Du kommenterer med bruk av din WordPress.com konto. Logg ut / Endre )

Twitter picture

Du kommenterer med bruk av din Twitter konto. Logg ut / Endre )

Facebookbilde

Du kommenterer med bruk av din Facebook konto. Logg ut / Endre )

Google+ photo

Du kommenterer med bruk av din Google+ konto. Logg ut / Endre )

Kobler til %s